Why does my NSManagedDataModel have no entities after I add another version of the DataModel?
MacBook Pro Late 2008, OS X 10.8.5, Xcode 5.0.2, Project has two apps, one OS X, one iOS, both share a datamodel Recently add a new dataModel Version DataModel involves four subClasses of NSManagedObject. Each of the four Classes received two identical changes, namely the addition of two attributes: modified NSDate uid NSString I did not select the option: Use scalar properties for primitive data types when generating the files of the four classes.
When the following four lines execute in the OS X app,
NSString *path = [[NSBundle mainBundle] pathForResource:@"SqliteFromXml" ofType:@"momd"];
NSURL *momdURL = [NSURL fileURLWithPath:path];
managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:momdURL];
NSLog(@"path=%@\nDataModel=%@\nEntities in DM=%@",path,managedObjectModel,[managedObjectModel entities]);
This is the output:
path=/Users/appleuser/SqliteFromXml/Debug/SqliteFromXml.app/Contents/Resources/SqliteFromXml.momd
DataModel=(<NSManagedObjectModel: 0x1001d1b80>) isEditable 0, entities {
}, fetch request templates {
}
Entities in DM=( )
The momd bundle is being created on each run, but is has 0 entities.
The .app bundle Contents looks this way:
https://www.dropbox.com/s/68iy8gjqbv0m0tq/Screenshot%202014-02-16%2018.03.02.png
Many Thanks, Mark