Skip to content

Commit

Permalink
Drop RestKitCoreData.momd from the resources bundle. It is not curren…
Browse files Browse the repository at this point in the history
…tly viable to load the entities because you cannot reference entities in one model from another within Xcode.
  • Loading branch information
blakewatters committed Mar 15, 2012
1 parent 7ff8746 commit a740a9c
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 45 deletions.
18 changes: 1 addition & 17 deletions Code/CoreData/RKManagedObjectStore.m
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,8 @@ - (id)initWithStoreFilename:(NSString *)storeFilename inDirectory:(NSString *)ni
// NOTE: allBundles permits Core Data setup in unit tests
nilOrManagedObjectModel = [NSManagedObjectModel mergedModelFromBundles:[NSBundle allBundles]];
}
NSMutableArray* allManagedObjectModels = [[NSMutableArray alloc] init];
[allManagedObjectModels addObject:nilOrManagedObjectModel];

NSBundle *restKitResourcesBundle = [NSBundle restKitResourcesBundle];
if (restKitResourcesBundle) {
NSURL* rkCoreDataLibraryMOMURL = [restKitResourcesBundle URLForResource:@"RestKitCoreData"
withExtension:@"momd"];
NSManagedObjectModel* rkCoreDataLibraryMOM = [[NSManagedObjectModel alloc] initWithContentsOfURL:rkCoreDataLibraryMOMURL];
if (rkCoreDataLibraryMOM) {
[allManagedObjectModels addObject:rkCoreDataLibraryMOM];
[rkCoreDataLibraryMOM release];
} else {
RKLogWarning(@"Unable to find RestKitCoreData.momd within the RestKitResources.bundle");
}
}

NSMutableArray* allManagedObjectModels = [NSMutableArray arrayWithObject:nilOrManagedObjectModel];
_managedObjectModel = [[NSManagedObjectModel modelByMergingModels:allManagedObjectModels] retain];
[allManagedObjectModels release];

if (nilOrNameOfSeedDatabaseInMainBundle) {
[self createStoreIfNecessaryUsingSeedDatabase:nilOrNameOfSeedDatabaseInMainBundle];
Expand Down
Binary file not shown.
Binary file not shown.
2 changes: 0 additions & 2 deletions RestKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@
259C3027151280A1003066A2 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 25EC1AE314F8022600C3CF3F /* [email protected] */; };
259C3028151280A1003066A2 /* whiteArrow.png in Resources */ = {isa = PBXBuildFile; fileRef = 25EC1AE414F8022600C3CF3F /* whiteArrow.png */; };
259C3029151280A1003066A2 /* [email protected] in Resources */ = {isa = PBXBuildFile; fileRef = 25EC1AE514F8022600C3CF3F /* [email protected] */; };
259C302A151280B0003066A2 /* RestKitCoreData.xcdatamodeld in Resources */ = {isa = PBXBuildFile; fileRef = 25EC1ADB14F8022600C3CF3F /* RestKitCoreData.xcdatamodeld */; };
25A34245147D8AAA0009758D /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25A34244147D8AAA0009758D /* Security.framework */; };
25B408261491CDDC00F21111 /* RKDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = 25B408241491CDDB00F21111 /* RKDirectory.h */; settings = {ATTRIBUTES = (Public, ); }; };
25B408271491CDDC00F21111 /* RKDirectory.h in Headers */ = {isa = PBXBuildFile; fileRef = 25B408241491CDDB00F21111 /* RKDirectory.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -2572,7 +2571,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
259C302A151280B0003066A2 /* RestKitCoreData.xcdatamodeld in Resources */,
259C3022151280A1003066A2 /* blackArrow.png in Resources */,
259C3023151280A1003066A2 /* [email protected] in Resources */,
259C3024151280A1003066A2 /* blueArrow.png in Resources */,
Expand Down
Binary file not shown.
Binary file not shown.

This file was deleted.

0 comments on commit a740a9c

Please sign in to comment.