My UITableView opens through PopOverViewController, so how can I load one of these cells automatically after loading the application,
cell selection process on MainViewController
- (void)setDetailItem:(id)newDetailItem {
if (detailItem != newDetailItem) {
[detailItem release];
detailItem = [newDetailItem retain];
label.text = [detailItem description];
}
}
and cell selection in TableViewController:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
myAppDelegate *appDelegate =
[[UIApplication sharedApplication] delegate];
appDelegate.viewController.detailItem = [list objectAtIndex:indexPath.row];
}
I use this code in a TableViewController but it doesn’t work! This means that after clicking the popOver button, the code simply selects the cell!
[myTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:0];
I used the above code in different methods such as viewDidAppear, viewWillAppearand didSelectRowAtIndexPathand ...
thank
source
share