My UITableView opens via PopOverViewController , so How can I load one of these cells automatically after app did load ,
the cell selecting process on MainViewController
- (void)setDetailItem:(id)newDetailItem {
if (detailItem != newDetailItem) {
[detailItem release];
detailItem = [newDetailItem retain];
//---update the view---
label.text = [detailItem description];
}
}
and cell selecting 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 TableViewController but does not work ! It means after press the the popOver button the code just highlight the cell !!
[myTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] animated:NO scrollPosition:0];
I used above code in different methods like viewDidAppear
, viewWillAppear
and didSelectRowAtIndexPath
and ...
Thank you
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…