Intermittent crashes in updateTrackingArea from delegate

Christiaan Hofman <[email protected]>
Newsgroups gmane.comp.macosx.devel
Message-ID <[email protected]>
I am sometimes getting crashes in a very unexpected place, and I can't get to figure out why, it makes no sense to me. The situation is pretty straight forward. It's an NSTableView subclass that adds tracking areas. Essentially, the method looks as follows (though I've split it, but that's not relevant):

- (void)rebuildTrackingAreas {
	if ([[self delegate] respondsToSelector:@selector(tableView:contextForTableColumn:row:)] == NO)
		return;
       
	// update my tracking areas here, the crasher also occurs when I return immediately
}

- (void)updateTrackingAreas {
	[super updateTrackingAreas];
	[self rebuildTrackingAreas];
}


The crasher takes place in the -respondsToSelector: line, which is called from -updateTrackingAreas. It's the usual and useless EXC_BAD_ACCESS. It seems that the delegate is not valid, I get it when I call anything on the delegate, for instance when I replace the whole rebuildTrackingAreas implementation with something like NSLog(@"%@", [self delegate]);. However, the debugger does not say the _delegate is out of scope, though it only gives an "isa" in its outline. 

I'm pretty much lost here, I can't think of anything more to check. Could anyone have an idea what i could do next to fix this?

thanks,
Christiaan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.