开发者

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?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜