core data - Why is NSPersistentStoreCoordinator not recognizing my managed object model? -
i trying create coredata store icloud. following example code in icloud programming guide core data, have piece of code:
nspersistentstorecoordinator *coordinator = [[nspersistentstorecoordinator alloc] initwithmanagedobjectmodel: salonbook.xcdatamodeld];
this image of managed object model
i'm getting error: use of undeclared identifier 'salonbook'.
why?
you're getting error because you're telling variable named salonbook
, not declared. need pass reference nsmanagedobjectmodel
instance here. commonly means you'd use self.managedobjectmodel
, depends on rest of code. steps need be:
- create
nsmanagedobjectmodel
instance model file - create
nspersistentstorecoordinator
using model object.
Comments
Post a Comment