views:

22

answers:

1

I am getting an EXC_BAD_ADDRESS crash when selecting a table's cell which should push a new view on the navigation controller.

Here is the stack trace (the CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION_ is always there):

alt text

I strongly suspect the new code I have added to load the initial data the app needs in a separate thread, partly because the init and loadView of the new view controller are being called and return fine. I am doing a [NSThread detachNewThreadSelector:@selector(loadData) toTarget:self withObject:nil]; in applicationDidFinishLaunching and then load a view showing a progress indicator. loadData does a [self performSelectorOnMainThread:@selector(setupMainUI) withObject:nil waitUntilDone:NO]; when data is ready. The UI (table and all) is loaded fine, the fresh data shows up great; it's only when a new view has to be pushed that the crash happens. Switching views via tab controller works fine as well.

Ideas? Thanks.

Update:

This is what I am doing to load the new view controller:

    NSArray *arrayForSection = [filteredGobos objectAtIndex:indexPath.section];
Employee *selectedEmployee = [arrayForSection objectAtIndex:indexPath.row];
if (self.employeeVC == nil) {
    EmployeeVC *emplVC = [[EmployeeVC alloc] initWithEmployee:selectedEmployee];
    self.employeeVC = emplVC;
}
[self.navigationController pushViewController:employeeVC animated:YES];
+1  A: 

You have overreleased an object. Your app is signaled when trying to release the autorelease pool. That means something in the pool already was released and dealloced before. Try Build&Analyse or NSZombies to find the problem.

I don't think it has to do with your threading, as want you mentioned there looks right to me.

tonklon
That was it. Not a threading issue. I was releasing an auto-released array in the new view controller.
raheel