PDA

View Full Version : UITableView




Nnavick
May 6, 2011, 11:01 AM
Hi,
I want to do that when the user hit the back button the highlighted cell color become the original color,because when I hit the back button it's stays in the highlighted color and not changed till I hit another cell.

How to do it?

Thanks!



0815
May 6, 2011, 11:09 AM
Hi,
I want to do that when the user hit the back button the highlighted cell color become the original color,because when I hit the back button it's stays in the highlighted color and not changed till I hit another cell.

How to do it?

Thanks!

forgot if there is an unselect ... but I think if you just call reloadData on the tableView that it won't be selected anymore.

Nnavick
May 6, 2011, 11:23 AM
forgot if there is an unselect ... but I think if you just call reloadData on the tableView that it won't be selected anymore.

non of this function is not working to me

-(void)viewWillAppear:(BOOL)animated {
NSLog(@"viewWillAppear");
}

-(void)viewDidDisappear:(BOOL)animated {
NSLog(@"viewDidDisappear");
}

-(void)viewWillDisappear:(BOOL)animated {
NSLog(@"viewWillDisappear");
}

why it's happening ?
maybe the view isn't nil?

dejo
May 6, 2011, 11:37 AM
Have you read the Table View Programming Guide for iOS yet, in particular the section on "Selections in Table Views"?

robbieduncan
May 6, 2011, 11:39 AM
The normal thing to do is to call the well documented deselectRowAtIndexPath:animated: (http://developer.apple.com/library/ios/documentation/uikit/reference/UITableView_Class/Reference/Reference.html#//apple_ref/occ/instm/UITableView/deselectRowAtIndexPath:animated:) in the delegate method tableView:didSelectRowAtIndexPath: (http://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UITableViewDelegate/tableView:didSelectRowAtIndexPath:).

jnoxx
May 6, 2011, 11:41 AM
non of this function is not working to me

-(void)viewWillAppear:(BOOL)animated {
NSLog(@"viewWillAppear");
}

-(void)viewDidDisappear:(BOOL)animated {
NSLog(@"viewDidDisappear");
}

-(void)viewWillDisappear:(BOOL)animated {
NSLog(@"viewWillDisappear");
}

why it's happening ?
maybe the view isn't nil?

Also, I don't see any [super viewWillLoad];
[super viewWillAppear:animated]; etc.

Nnavick
May 6, 2011, 12:04 PM
The normal thing to do is to call the well documented deselectRowAtIndexPath:animated: (http://developer.apple.com/library/ios/documentation/uikit/reference/UITableView_Class/Reference/Reference.html#//apple_ref/occ/instm/UITableView/deselectRowAtIndexPath:animated:) in the delegate method tableView:didSelectRowAtIndexPath: (http://developer.apple.com/library/ios/documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UITableViewDelegate/tableView:didSelectRowAtIndexPath:).

thank you!!!
It works perfectly!