Skip to content

Commit

Permalink
Moved registerStoreClass to +initialize, so it happens only once when…
Browse files Browse the repository at this point in the history
… the class initializes
  • Loading branch information
martijnthe committed Feb 28, 2012
1 parent 637a5b9 commit d85f6e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions IncrementalStoreTest/BandCampIS.m
Expand Up @@ -26,6 +26,10 @@ - (NSArray*)fetchTracksForAlbumWithId:(NSManagedObjectID*)objectID trackEntity:(

@implementation BandCampIS

+ (void)initialize {
[NSPersistentStoreCoordinator registerStoreClass:[BandCampIS class] forStoreType:[BandCampIS type]];
}

+ (NSString*)type {
return @"BandCampIS";
}
Expand Down
2 changes: 0 additions & 2 deletions IncrementalStoreTestTests/IncrementalStoreTestTests.m
Expand Up @@ -38,8 +38,6 @@ - (void)setUp
}
NSManagedObjectModel* model = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];


[NSPersistentStoreCoordinator registerStoreClass:[BandCampIS class] forStoreType:BANDCAMP_STORE_TYPE];
NSPersistentStoreCoordinator* coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model];
NSError* err = nil;
[coordinator addPersistentStoreWithType:[BandCampIS type] configuration:nil URL:nil options:nil error:&err];
Expand Down

0 comments on commit d85f6e5

Please sign in to comment.