ios - URL to NSManagedObjectModel is NULL -
i reworked core data model app, beyond point lightweight migration work. have 2 core data models in app bundle , need access each individually (for regular core data setup , manual migration), means [nsmanagedobjectmodel mergedmodelfrombundles:nil]
inappropriate / wouldn't work. problem cannot url either model, prevents me instantiating them [nsmanagedobjectmodel alloc] initwithcontentsofurl:
. these methods i'm using, , both return null:
- (nsurl *)currentmodelurl{ return [[nsbundle mainbundle] urlforresource:@"newmodel" withextension:@"momd"]; } - (nsurl *)oldmodelurl{ return [[nsbundle mainbundle] urlforresource:@"oldmodel" withextension:@"momd"]; }
in fact, when try method on other apps, ones single model, never returns model url. odd, previous version of app ran fine getting model via url using method above... not [nsmanagedobjectmodel mergedmodelfrombundles]
.
i have read this , this , tried proposed solutions, include ensuring models added list of resources copy bundle in build phase, verifying case-sensitive filenames, , fidgeting file extensions in urlforresource
method. suppose render new model new version of old 1 , prevent automatic migration in persistent store options... approach should work. why impossible urls models in app bundle?
the method working 100% file not there ;)
either got typo.. or case wrong or model isn't versioned (!)
compile app , in %appp%/resources/. there oldmodel.momd folder?
Comments
Post a Comment