开发者

Strange crash on selecting a UITableView cell

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 http://dl.dropbox.com/u/71415/crash_threads.jpg

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开发者_JAVA技巧 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];


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜