Skip to content

Commit

Permalink
load MOM from PiwikTracker class's bundle
Browse files Browse the repository at this point in the history
prevents exceptions when integrated as a framework
  • Loading branch information
bgerstle committed Oct 6, 2015
1 parent cfa4e08 commit 139d573
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion PiwikTracker/PiwikTracker.m
Expand Up @@ -1565,7 +1565,7 @@ - (NSManagedObjectModel*)managedObjectModel {
return _managedObjectModel;
}

NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"piwiktracker" withExtension:@"momd"];
NSURL *modelURL = [[NSBundle bundleForClass:[self class]] URLForResource:@"piwiktracker" withExtension:@"momd"];
_managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];

return _managedObjectModel;
Expand Down

0 comments on commit 139d573

Please sign in to comment.