NSFetchedResultsController and BAD_ACCESS
I have a UITableViewController
that is fed by a NSFetchedResultsController
.
Everything worked fine, until I added
if (self.fetchedResultsController != nil)
{
return self.fetchedResultsController;
}
to the beginning of my
-(NSFetchedResultsController *)fetchedResultsController {
method. The error I get is:
Program received signal: “EXC_BAD_ACCESS”.
Any idea why this could be? I declare
@property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController;
in the .h file and
@synthesize fetchedResultsController
in the implementation file.
开发者_JAVA技巧Thank you~
Is that setting up a recursive call, with self.fetchedResultsController invoking the fetchedResultsController method?
Looks like you're referencing an uninitialised pointer. Have you initialised fetchedResultsController
? In your class's init method add:
fetchedResultsController = nil;
Does this help?
精彩评论