0

My detail view wont change when the row is selected unless I reassign what the detailItem is.

I wonder how to fix this problem.

- (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;
   }
}
ForceMagic
  • 6,230
  • 12
  • 66
  • 88

1 Answers1

0

Well I found the solution, the new template for xcode 4.3 for a MasterDetail is kinda filled with a bunch of stuff not needed for a more custom app. All I had to do was remove

self.detailViewController.detailItem = self;

With

self.detailViewController.detailItem = self.detailViewController._plantnames;

And then get rid of all the other stuff that I am not using.