Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FetchResultController delegate - incompatible types warning

I'm trying to connect my CoreData to iCloud using NSFetchedResultController basing on iCloud example.

NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:@"date" cacheName:@"Root1"];
aFetchedResultsController.delegate = self;

However i get such warning on second line: warning: Semantic Issue: Passing 'RootViewController *const __strong' to parameter of incompatible type 'id'. I think that setting delegate to self should be ok, but it's not. Anybody can help?

like image 402
Nat Avatar asked Jan 03 '12 12:01

Nat


1 Answers

Make RootViewController conform to the NSFetchedResultsControllerDelegate protocol.

@interface RootViewController : UIViewController <NSFetchedResultsControllerDelegate>
like image 71
albertamg Avatar answered Oct 05 '22 02:10

albertamg