The iPhone/iTouch Contacts app has a very cool feature. Once you have tapped on a contact, the application highlights the contactâ€™s name and then navigates to the contactâ€™s details. When you hit the â€œAll Contactsâ€ button to return to the main view of the application, the UITableViewCell that was selected fades from blue to white. Neat!
GIVE ME THE CODE!
Hereâ€™s how itâ€™s done. Add the code below to your UITableViewController. Thatâ€™s it. Thatâ€™s all.
- -(void)viewDidAppear: (BOOL)animated
- [super viewDidAppear:animated];
- NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
- if(indexPath != nil)
- [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
- NSLog(@"deselecting this fucking row");
You need to login to post a comment.