I am trying to create a CoreData store with iCloud. Following the example code in iCloud Programming Guide for Core Data, I have this piece of code:
NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel: salonbook.xcdatamodeld];
This is the image of my managed object model
I'm getting an error: Use of undeclared identifier 'salonbook'.
Why?
You're getting the error because you're telling it to look for a variable named salonbook
, which is not declared. You need to pass a reference to an NSManagedObjectModel
instance here. Commonly that means you'd use self.managedObjectModel
, but that really depends on the rest of your code. The steps need to be:
NSManagedObjectModel
instance from the model fileNSPersistentStoreCoordinator
using that model object.