0
我的詳細信息視圖不會改變,當行被選中,除非我重新指定detailItem
是什麼。detailView問題在分割視圖masterView
我想知道如何解決這個問題。
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
NSManagedObject *object = [[self fetchedResultsController] objectAtIndexPath:indexPath];
self.detailViewController.detailItem = object;
switch (indexPath.row) {
case 0:
[self.detailViewController setPlantNames:@"monarch"];
break;
case 1:
[self.detailViewController setPlantNames:@"queen"];
break;
case 2:
[self.detailViewController setPlantNames:@"viceroy"];
break;
default:
break;
}
self.detailViewController.detailItem = self;
}
}