Skip to content
This repository has been archived by the owner on May 9, 2018. It is now read-only.

Commit

Permalink
#580 : use bundleForClass to load resources
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardini committed Apr 3, 2015
1 parent 12d45f7 commit 1184dad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions MapView/Map/RMMapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,14 @@ + (UIImage *)resourceImageNamed:(NSString *)imageName

+ (NSString *)pathForBundleResourceNamed:(NSString *)name ofType:(NSString *)extension
{
NSAssert([[NSBundle mainBundle] pathForResource:@"Mapbox" ofType:@"bundle"], @"Resource bundle not found in application.");

NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"Mapbox" ofType:@"bundle"];

if (!bundlePath) {
bundlePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Mapbox" ofType:@"bundle"];
}

NSAssert(bundlePath, @"Resource bundle not found in application.");

NSBundle *resourcesBundle = [NSBundle bundleWithPath:bundlePath];

return [resourcesBundle pathForResource:name ofType:extension];
Expand Down

0 comments on commit 1184dad

Please sign in to comment.