views:

38

answers:

0

I am getting an EXC_BAD_ACCESS when trying to push a view controller onto the navigation stack. When enabling NSZombies, I do not get any extra information for some reason, and I can't work out why. I'm pretty certain I don't need to use CFZombies. Here is the code that seems to be causing the issue:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
/*
 <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
 // ...
 // Pass the selected object to the new view controller.
 [self.navigationController pushViewController:detailViewController animated:YES];
 [detailViewController release];
 */

// Keep track of the row selected
selectedIndexPath = indexPath;

if (evController == nil) {
    evController = [[EditViewController alloc] initWithNibName:@"EditView" bundle:nil];
}

// Find out which field is being edited
switch (indexPath.section) {
    case 0:
        evController.keyOfTheFieldToEdit = @"coffeeName";
        evController.editValue = coffeeObj.coffeeName;
        break;
    case 1:
        evController.keyOfTheFieldToEdit = @"price";
        evController.editValue = [coffeeObj.price stringValue];
        break;
}

// Object being edited
evController.objectToEdit = coffeeObj;

// Push the edit view controller on to the top of the stack
[self.navigationController pushViewController:evController animated:YES];
}

Any ideas why NSZombie would not work?