views:

107

answers:

2

Hi, My problem is when trying to load a detail view through a table cell, the application constantly crashes. The error that comes up when running through debug is "__TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___" objc exception thrown. If anyone can help me it would be greatly appreciated.

Here is a screenshot for the debug, I am not sure if I am interpreting it right http://img43.imageshack.us/img43/2143/errorud.png

Here is my code where I beleive the error is happening:

- (void)tableView:(UITableView *)tableView  didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSInteger row = [indexPath row];
if(self.moreDetailView == nil){
    DetailViewController *dvController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]];
    self.moreDetailView = dvController;
    [dvController release];
}
else{}
moreDetailView.title = [NSString stringWithFormat:@"%@", [listOfItems objectAtIndex:row]];

goHerdv2AppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate.detailView pushViewController:moreDetailView animated:YES];}
A: 

You should try putting in some breakpoint(s) before the failure point and then step forward until it crashes.

Then, do it again, watching the value of moreDetailView, delegate, etc. to see if the value changes and/or is defined correctly.

It should become fairly obvious what is going on.

Jeff B
When trying to step through the problems I encountered this error:'-tableView:didSelectRowAtIndexPath: - Line 87'I am relatively new to objective-C and not quite sure what this means
Jeb Sears
That is the error in the console. Are you setting breakpoints and stepping with the debugger window?
Jeff B
Maybe this is the error I'm looking for:Using legacy cell layout due to delegate implementation of tableView:accessoryTypeForRowWithIndexPath: in <MoreViewControoler: 0x3b13db0>. Please remove your implementation of this method and set the cell properties accessoryType and/or editingAccessoryType to move to the new cell layout behavior. This method will no longer be called in a future release.
Jeb Sears
This was not the problem, I commented out the method in question and still getting the crash.
Jeb Sears
A: 

Maybe you forgot to set the view outlet in your nib?

Marian Busoi