...
|
...
|
@@ -405,16 +405,20 @@ |
|
|
|
|
|
+ (UIImage *)resourceImageNamed:(NSString *)imageName
|
|
|
{
|
|
|
NSAssert([[NSBundle mainBundle] pathForResource:@"MapBox" ofType:@"bundle"], @"Resource bundle not found in application.");
|
|
|
|
|
|
if ( ! [[imageName pathExtension] length])
|
|
|
imageName = [imageName stringByAppendingString:@".png"];
|
|
|
|
|
|
NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"MapBox" ofType:@"bundle"];
|
|
|
return [UIImage imageWithContentsOfFile:[[self class] pathForBundleResourceNamed:imageName ofType:nil]];
|
|
|
}
|
|
|
|
|
|
+ (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"];
|
|
|
NSBundle *resourcesBundle = [NSBundle bundleWithPath:bundlePath];
|
|
|
NSString *imagePath = [resourcesBundle pathForResource:imageName ofType:nil];
|
|
|
|
|
|
return [UIImage imageWithContentsOfFile:imagePath];
|
|
|
return [resourcesBundle pathForResource:name ofType:extension];
|
|
|
}
|
|
|
|
|
|
- (void)dealloc
|
...
|
...
|
|