views:

41

answers:

2

Hi all,

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.

Thank you~

+3  A: 

Is that setting up a recursive call, with self.fetchedResultsController invoking the fetchedResultsController method?

Graham Perks
+1 looks like that
Anders K.
A: 

Looks like you're referencing an uninitialised pointer. Have you initialised fetchedResultsController? In your class's init method add:

fetchedResultsController = nil;

Does this help?

Simon Whitaker