How to manage the uitableviewcell after being scrolled?

Hi all.
I manipulated the cell of the table view to be a custom one, which will be expanded(from height=50 to height=100) on selection and will be srinked to original(from height=100 to height=50) on second click or deselction. Now my problem is that i am selecting a row and without deselecting it or without clicking it for second time if i am scrolling the table ,the cell should reload to the original(height=50) srinked one. Here the view is reloading but the height for that row is not srinking(still height for that row remains to be 100). Can anyone have tried like this? Plz help me to sort out the problem.
Tanks in advance.
Satya.

Well sorry for late responsse, here is the code:_
@interface HomeControl : UIViewController<UIScrollViewDelegate,UITableViewDelegate,UITableViewDataSource >
          IBOutlet UITableView *newsTable;
          NSArray *dataArray;
          NSMutableArray *selectedRowArray,*clickedCountArray;
          CGRect frame;
@property (nonatomic,retain) UITableView *newsTable;
@property (nonatomic,retain) NSArray *dataArray;
@property (nonatomic,retain) NSMutableArray *selectedRowArray,*clickedCountArray;
@end
@implementation HomeControl
@synthesize newsTable,dataArray,selectedRowArray,clickedCountArray;
- (void)viewDidLoad
          //table view section
                    NSDictionary *row1=[[NSDictionary alloc] initWithObjectsAndKeys:@"News",@"newsCatagory",@"News Title",@"newsTitle",nil],*row2=[[NSDictionary alloc] initWithObjectsAndKeys:@"News'it",@"newsCatagory",@"News Title",@"newsTitle",nil],*row3=[[NSDictionary alloc] initWithObjectsAndKeys:@"News",@"newsCatagory",@"News Title",@"newsTitle",nil],*row4=[[NSDictionary alloc] initWithObjectsAndKeys:@"Fashion",@"newsCatagory",@"Good Deal Title",@"newsTitle",nil],*row5=[[NSDictionary alloc] initWithObjectsAndKeys:@"News",@"newsCatagory",@"News Title",@"newsTitle",nil];
                    NSArray *a=[[NSArray alloc] initWithObjects:row1,row2,row3,row4,row5,nil];
                    self.dataArray=a;
                    [row1 release];[row2 release];[row3 release];[row4 release];[row5 release];[a release];
                    selectedRowArray=[[NSMutableArray alloc] initWithCapacity:dataArray.count];
                    clickedCountArray=[[NSMutableArray alloc] initWithCapacity:dataArray.count];
                    for(int i=0; i<[dataArray count]; i++)
                              [selectedRowArray addObject:[NSNumber numberWithInt:0]];
                              [clickedCountArray addObject:[NSNumber numberWithInt:0]];
- (void)viewDidUnload
          // Release any retained subviews of the main view.
          // e.g. self.myOutlet = nil;
          self.newsTable=nil; self.selectedRowArray=nil;          self.clickedCountArray=nil;
          self.dataArray=nil;
          [super viewDidUnload];
- (void)dealloc
          [newsTable release]; [selectedRowArray release]; [clickedCountArray release];
          [dataArray release];
    [super dealloc];
#pragma mark Custom Methods
-(void)cellWithDataInTableForCell:(TableDataCellControl*)tCell withIndexPath:(NSIndexPath*)ip
          NSUInteger r=[ip row];
          NSDictionary *rowdata=[self.dataArray objectAtIndex:r];
          tCell.newsL.text=[rowdata objectForKey:@"newsCatagory"];
          tCell.title.text=[rowdata objectForKey:@"newsTitle"];
          if(tCell.newsL.text==@"Fashion")
                    tCell.rowImage.image=[UIImage imageNamed:@"orange.png"];
          else if(tCell.newsL.text==@"News'it")
                    tCell.rowImage.image=[UIImage imageNamed:@"IT-Icon.png"];
                    tCell.rowImage.backgroundColor=[UIColor clearColor];
          else
                    tCell.rowImage.image=nil;
          NSDateFormatter *formatter=[[NSDateFormatter alloc] init];
          [formatter setDateFormat:@"dd-MM-yyyy HH:mm"];
          tCell.timeL.text=[formatter stringFromDate:[NSDate date]];
          [formatter release];
-(void)accessViewForCell:(TableDataCellControl*)tCell
          UILabel *l=[[UILabel alloc] initWithFrame:CGRectMake(0,0,10,12)];
          l.textAlignment=UITextAlignmentCenter;
          l.backgroundColor=[UIColor clearColor];
          l.textColor=[UIColor blueColor];
          if(tCell.selectedRow==0) l.text=@">";
          else l.text=@"<";
          tCell.accessoryView=l;
          tCell.accessoryView.userInteractionEnabled=YES;
          [l release];
#pragma mark Table DataSource Methods
-(NSInteger)tableView:(UITableView *)tv numberOfRowsInSection:(NSInteger)s
          return [self.dataArray count];
-(NSString *)tableView:(UITableView *)tv titleForHeaderInSection:(NSInteger)s
          if(s==0)
                    return [NSString stringWithString:@"Actuallite"];
          else
                    return nil;
-(UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)ip
          static NSString *cid=@"CID";
          TableDataCellControl *tCell=(TableDataCellControl *)[tv dequeueReusableCellWithIdentifier:cid];
          if([[clickedCountArray objectAtIndex:ip.row] intValue]%2==0)
                    if(tCell==nil)
                              NSArray *cellNib=[[NSBundle mainBundle] loadNibNamed:@"TableCell" owner:self options:nil];
                              for(id ob in cellNib)
                                        if([ob isKindOfClass:[TableDataCellControl class]])
                                                  tCell=(TableDataCellControl *)ob;
                    tCell.selectedRow=[[selectedRowArray objectAtIndex:ip.row] intValue];
                    tCell.rowClicked=[[clickedCountArray objectAtIndex:ip.row] intValue];
                    [self cellWithDataInTableForCell:tCell withIndexPath:ip];
                    [self accessViewForCell:tCell];
          else
                    if(tCell==nil)
                              NSArray *cellNib=[[NSBundle mainBundle] loadNibNamed:@"TableCellExtended" owner:self options:nil];
                              for(id ob in cellNib)
                                        if([ob isKindOfClass:[TableDataCellControl class]])
                                                  tCell=(TableDataCellControl *)ob;
                    tCell.selectedRow=[[selectedRowArray objectAtIndex:ip.row] intValue];
                    tCell.rowClicked=[[clickedCountArray objectAtIndex:ip.row] intValue];
                    [self cellWithDataInTableForCell:tCell withIndexPath:ip];
                    [self accessViewForCell:tCell];
          return tCell;
-(void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)ip
          TableDataCellControl *tCell=(TableDataCellControl *)[tv cellForRowAtIndexPath:ip],*newCell;
          tCell.rowClicked+=1;
          [clickedCountArray replaceObjectAtIndex:ip.row withObject:[NSNumber numberWithInt:tCell.rowClicked]];
          if(tCell.selectedRow==0)
                    tCell.selectedRow=1;
                    [selectedRowArray replaceObjectAtIndex:ip.row withObject:[NSNumber numberWithInt:tCell.selectedRow]];
          else
                    tCell.selectedRow=0;
                    [selectedRowArray replaceObjectAtIndex:ip.row withObject:[NSNumber numberWithInt:tCell.selectedRow]];
          [tv reloadRowsAtIndexPaths:[NSArray arrayWithObject:ip] withRowAnimation:UITableViewRowAnimationFade];
          tCell=(TableDataCellControl*)[tv cellForRowAtIndexPath:ip];
          if(tCell!=nil)
                    for(id ob in tCell.contentView.subviews)
                              [ob removeFromSuperview];
          NSArray *cellNib=[[NSBundle mainBundle] loadNibNamed:@"TableCellExtended" owner:self options:nil];
          for(id ob in cellNib)
                    if([ob isKindOfClass:[TableDataCellControl class]])
                              newCell=(TableDataCellControl *)ob;
          [self cellWithDataInTableForCell:newCell withIndexPath:ip];
          //[self accessViewForCell:tCell];
          [tCell.contentView addSubview:newCell.contentView];
          if((tCell.selectedRow==0)&&(tCell.rowClicked%2==0))
                    [self tableView:tv didDeselectRowAtIndexPath:ip];
-(void)tableView:(UITableView *)tv didDeselectRowAtIndexPath:(NSIndexPath *)ip
          [clickedCountArray replaceObjectAtIndex:ip.row withObject:[NSNumber numberWithInt:0]];
          [selectedRowArray replaceObjectAtIndex:ip.row withObject:[NSNumber numberWithInt:0]];
          int c,s;
          c=[[clickedCountArray objectAtIndex:ip.row] intValue];s=[[selectedRowArray objectAtIndex:ip.row] intValue];
          [tv reloadRowsAtIndexPaths:[NSArray arrayWithObject:ip] withRowAnimation:UITableViewRowAnimationFade];
          TableDataCellControl *tCell=(TableDataCellControl *)[tv cellForRowAtIndexPath:ip],*newCell;
          if(tCell!=nil)
                    for(id ob in tCell.contentView.subviews)
                              [ob removeFromSuperview];
          NSArray *cellNib=[[NSBundle mainBundle] loadNibNamed:@"TableCell" owner:self options:nil];
          for(id ob in cellNib)
                    if([ob isKindOfClass:[TableDataCellControl class]])
                              newCell=(TableDataCellControl *)ob;
          [self cellWithDataInTableForCell:newCell withIndexPath:ip];
          //[self accessViewForCell:tCell];
          [tCell.contentView addSubview:newCell.contentView];
-(CGFloat)tableView:(UITableView *)tv heightForRowAtIndexPath:(NSIndexPath *)ip
          int cliked=[[clickedCountArray objectAtIndex:ip.row] intValue],selection=[[selectedRowArray objectAtIndex:ip.row] intValue];
          int check=(cliked%2==0)&&(selection==0)?0:1;
          switch (check)
                    case 0:
                              return 49;
                              break;
                    case 1:
                              return 100;
                              break;
                    default:
                              return 49;
                              break;
@end

Similar Messages

  • How to manage the tables after deploying an SDA for Oracle

    How can I manage the tables after deploying an SDA  on Oracle.There is tool for MaxDB,but how can I connection to the Oracle Database?
    Thanks

    In J2ee administrator console

  • RESTORING THE DATABASE AFTER BEING EDITED OR DELETED

    How to restore the database after being edited? I m using sql server 2008 R2, I've done backup with some foolish knowledge and many tables have disappeared from the database. I want to get them back. Please help me.

    Do you have backup which includes data which has been edited/removed by you .If so below query might help.
    use master
    go
    alter database db_name set single_user with rollback immediate
    go
    restore database db_name from disk='locaion of backup'
    with replace,recovery
    If you have transaction lgo backups as well please dont use above method.In such case you will need to  first restore full backup with no recovery like below and then apply all transaction logs with no recovery
    but the last transaction log with recovery( last trn log just before you edited)
    use master
    go
    alter database db_name set single_user with rollback immediate
    go
    restore database db_name from disk='locaion of backup'
    with replace,norecovery
    Hope this helps
    More details in below link
    http://www.karaszi.com/SQLServer/info_minimizing_data_loss.asp
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Hi Apple, I was developed an app that impemented In-App purchage, But how I manage the customer reinstall after the trial priod complets. thanking you.

    Hi Apple,
    I was developed an app that impemented In-App purchage,
    But how I manage the customer to reinstall after the trial priod complets.
    Thanking you.

    These forums are user supported.
    So are the iOS Dev Center forums [ https://devforums.apple.com/community/ios ], although staffers do drop in as volunteers from time to time.

  • How do i recover files after being trashed?

    how do i recover files after being trashed?

    If you emptied the trash, you don't unless they are on your backup disk.

  • How to manage the memory in i pad

    how to manage the memory in i pad

    Use iTunes on your computer to store items that you want to save but are not needed on the iPad. Learn to sync and also learn how to do file transfers. Delete unneeded items from the iPad.
    When you connect your iPad to iTunes you will see a bar describing how much of your storage space is being used on your iPad. I always suggest leaving plenty of space open for the iOS and apps to operate.

  • How to manage the host root folder?

    I'm using iWeb08, and I'm on system OSX 10.5.8.
    Last week I flawlessly transferred my site from Apple to another host.
    My question is, to make a few simple changes to it, {mostly text and links}, do I have to load up ALL the files again to the ftp host?  I don't know how to manage the root folder yet and I don't want to clutter the folder or cause the site to malfunction.
    Is there any useful posts on managing a hosting root folder??
    Problems or thing I should know using iWeb08?
    Thanks...  Ghary.com

    Once you get to know the file structure its possible to just upload the changed files by intelligent guesswork.
    You can also look at the date on the local published files but this would be rather time consuming.
    Most FTP apps have a synchronise feature to handle this for you but you need to set this up carefully and do a test run to make sure it doesn't wipe out essential files on the server.
    If you do a lot of updates and you want to get your web pages downloading faster, an optimizer will do all the thinking for you. These screenshots are of one of Ton Brand's Optimizers - HTML Optimizer Plus
    On the first pass all the files are optimized and uploaded...
    After that, Smart Handling is turned on and only the changed files are processed...
    The original folder is 10.1 MB and the Optimized one is 7.7 MB. That's without optimizing the PNG images. The finished site downloads fast. It needs to since its designed to work on mobile devices.

  • Hi someone, I went to muse theme and browse widgets to find the toolbox 024 of google language translator, i saw the video explaining how to manage the widgets but now where can i found it to include it in my website because the french version of muse don

    Hi someone, I went to muse theme and browse widgets to find the toolbox 024 of google language translator, i saw the video explaining how to manage the widgets but now, where can i found it to include it in my website because the french version of muse don't have several free widgets for people like me who pay every month the application.Thanks

    I'm not aware of a free translator widget.
    I found these...
    Website Translator 
    Translator Widget  $6.99 for the widget
    Adobe Muse TB024 Widget | MuseThemes.com  $69/year Includes everything | I signed up for this and it's been well worth it, they have new themes & widgets every month.

  • Images burn into the screen after being there for only a few minutes?

    What's wrong with my mac if images burn into the screen after being there for only a few minutes?
    I can have an icon, like a folder or something, on my desktop for only a few minutes and then when I move it an image of it will be burned into the screen for another few minutes. Same thing happens with having a webpage open for a few minutes or word document. What part of my computer is malfunctioning and is Apple responsible for repairing it?

    Hi,
    Does it happen on all desktops applications as well as Modern UI Apps? Since this issue only happened recently, I suspect a newly-installed third party program causes this issue, please check these programs if possible.
    We can also boot into clean boot mode, test the issue.
    http://support.microsoft.com/KB/929135
    Run a virus scan to eliminate some malware\virus
    Similiar issue
    https://social.technet.microsoft.com/Forums/en-US/125204a0-937e-4bc6-bb60-8fe3244b4514/all-windowsapplications-keep-minimizing-on-their-own-windows-81?forum=w8itprogeneral 
    Yolanda Zhu
    TechNet Community Support

  • How to stop the Dialog from being dragged

    I was hoping that someone could tell me when calling a Dialog from Jframe, a how to stop the Dialog from being dragged
    while a dialog is showing.
    When it is visible I can still click and drag the Dialog
    I want to set it so you can not drag it until the dialog has be closed.

    If you don't have access to the parent frame, a "hack" that usually works:
    Frame frame = Frame.getFrames()[0];
    if (null != frame && frame instanceof JFrame){
    JFrame jf = (JFrame)frame;
    JDialog jd = new JDialog(jf, "title");
    ... code here ...
    As each JFrame (or Frame) is opened, its stored in the array of Frames that you can get. Same thing with Dialog.getDialogs(). Almost always, at least so far for me I've never had this problem, the [0] index is the main window opened, or the parent/top frame. I'd put the check in there to be safe and make sure its a JFrame and usually you'll only have the one JFrame.

  • How to enable the screen after triggering the error message

    Hi All,
    we have a tcode IW31, in that one field(WBS element -PROID) is not mandatory. so we have written the following code to make it mandatory in a user exit EXIT_SAPLCOIH_010.It's triggering the error message, but it is going into disable mode. Please sugget me how to enable the screen after getting the error message triggering.
    if not caufvd_imp-proid is initial.
      select single * from t350 into wa_t350
              where  auart    = caufvd_imp-auart
                and  imord    = 'X'.
      if sy-subrc is initial.
        pspel = caufvd_imp-proid.
      else.
        call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
             exporting
                  input  = caufvd_imp-proid
             importing
                  output = l_posid.
        concatenate text-t10 l_posid text-t11
                    into l_textline1 separated by space.
        message i208(00) with l_textline1.
      endif.
    else.
      message e208(00) with 'Please maintain WBS element in Location Tab'.
    endif.
    Thanks

    Hi,
    Instead of error message use status message like
    message s208(00) with 'Please maintain WBS element in Location Tab'.
    Leave to screen sy-synnr.
    This will allow to move to the screen and have in enable mode.
    WIth Regards,
    Dwaraka.S
    Edited by: Dwarakanath Sankarayogi on Feb 13, 2009 7:46 AM

  • Anyone knows how to get the photos after IMG_9999 from iphone? :-(ps:... i got them all in my camera roll but when i connected to the computer there's nothing after IMG_9999..

    anyone knows how to get the photos after IMG_9999 from iphone? :-(ps:... i got them all in my camera roll but when i connected to the computer there's nothing after IMG_9999.. many thanks :-)

    They show in the camera roll, just not your computer?
    Have you checked every folder that is in the DCIM folder?

  • How to suspend the installation after downloading packages via ota for lollipop 5.0.1. on my Note 4. always asks me to install it on notification bar. thank you :)

    How to suspend the installation after downloading packages via ota for lollipop 5.0.1. on my Note 4. always asks me to install it on notification bar. thank you

    If you factory reset, it wont make the update go away, but you should back up and reset before you install the update.

  • How to manage the files in Ipod?

    Hi everybody!
    I just bought a 80GB Ipod and I'm having a hard time figuring it out how to manage the files I've downloaded to it. I just sent a podcast to it but it doesn't appear it the Podcast folder. I have to search it in the entire list of files. Can someone tell me how I can manage these files?
    Thank you very much!

    Hi everybody!
    I just bought a 80GB Ipod and I'm having a hard time
    figuring it out how to manage the files I've
    downloaded to it. I just sent a podcast to it but it
    doesn't appear it the Podcast folder. I have to
    search it in the entire list of files. Can someone
    tell me how I can manage these files?
    Thank you very much!
    Use iTunes.

  • HT4847 How i can download my backup data? And how to manage the data on i Cloud?

    How i can download my backup data? And how to manage the data on i Cloud?

    You can't download an iCloud backup, except to restore it to your device should you ever need to.
    iCloud data can be managed within the apps on your iPad.  Any changes to the data within the apps corresponding to the data you are syncing with iCloud will take place in iCloud.  You can also manage some of this data on icloud.com from your computer.
    This article explains ways to manage your iCloud storage space, should you need to reduce you iCloud storage: http://support.apple.com/kb/ht4847.

Maybe you are looking for

  • How do I get an iphoto library that is stored on an external HD to show up in apple tv?

    I recently moved my iphoto library from my iMac HD to an Airport Extreme Time Capsule because I ran out of space on my iMac's HD. Since the move, I can't view any of my photos through Apple TV like I had been able to when the library was on the iMac

  • NEXT button on report portlet shows 10 rows-maximum rows per page=9999

    I created a report with the DB Provider portlet. I set the maximum rows per page to 9999 when displayed as a portlet and as a full page. I put the portlet on a page and it only shows 10 rows and then the next button. If there are exactly 10 rows I ge

  • How to extract Org.unit Hierarches in BI 7.0

    Hi experts, I am developing HCM BI reports, right now I am into Org management and Personnel Administration, I am new to HCM. my doubts are clarified in existing discussions in the forum. queries: 1) how to create hierarchies of Org. units in BI 7.0

  • How to read multiple files of different name using single file adapter

    There are two inbound locations inbound1 and inbound2 , and the files structure present in these two inbound locations are same but the files start with different names example (1)files in inbound1 starts with file1,file2... (2)files in inbound2 star

  • Disable Delete in MIR4

    Dear All, I have a requirement from my Team to deactivate delete option from MIR4 Transaction I have created Transaction Variant for MIR4 and disabled the delete Option from Menu. At the same time, I created Group Name for assigning the Users to this