开发者

NSFetchedResultsController and BAD_ACCESS

开发者 https://www.devze.com 2023-01-13 06:45 出处:网络
I have a UITableViewController that is fed by a NSFetchedResultsController. Everything worked fine, until I added

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?

0

精彩评论

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