Authored by Quazie

Reverting change from r280. By trying to get the resources from the RouteMe bun…

…dle (which didn't exist) a slight bug was occuring with invalid paths
@@ -38,7 +38,7 @@ static RMConfiguration* RMConfigurationSharedInstance = nil; @@ -38,7 +38,7 @@ static RMConfiguration* RMConfigurationSharedInstance = nil;
38 if (RMConfigurationSharedInstance != nil) return RMConfigurationSharedInstance; 38 if (RMConfigurationSharedInstance != nil) return RMConfigurationSharedInstance;
39 39
40 RMConfigurationSharedInstance = [[RMConfiguration alloc] 40 RMConfigurationSharedInstance = [[RMConfiguration alloc]
41 - initWithPath: [[NSBundle bundleForClass:@"RMConfiguration"] pathForResource:@"routeme" ofType:@"plist"]]; 41 + initWithPath: [[NSBundle mainBundle] pathForResource:@"routeme" ofType:@"plist"]];
42 42
43 return RMConfigurationSharedInstance; 43 return RMConfigurationSharedInstance;
44 } 44 }
@@ -246,7 +246,7 @@ static CGImageRef _markerBlue = nil; @@ -246,7 +246,7 @@ static CGImageRef _markerBlue = nil;
246 246
247 + (CGImageRef) loadPNGFromBundle: (NSString *)filename 247 + (CGImageRef) loadPNGFromBundle: (NSString *)filename
248 { 248 {
249 - NSString *path = [[NSBundle bundleForClass:@"RMMarker"] pathForResource:filename ofType:@"png"]; 249 + NSString *path = [[NSBundle mainBundle] pathForResource:filename ofType:@"png"];
250 CGDataProviderRef dataProvider = CGDataProviderCreateWithFilename([path UTF8String]); 250 CGDataProviderRef dataProvider = CGDataProviderCreateWithFilename([path UTF8String]);
251 CGImageRef image = CGImageCreateWithPNGDataProvider(dataProvider, NULL, FALSE, kCGRenderingIntentDefault); 251 CGImageRef image = CGImageCreateWithPNGDataProvider(dataProvider, NULL, FALSE, kCGRenderingIntentDefault);
252 [NSMakeCollectable(image) autorelease]; 252 [NSMakeCollectable(image) autorelease];
@@ -48,7 +48,7 @@ static RMTileImage *_loadingTile = nil; @@ -48,7 +48,7 @@ static RMTileImage *_loadingTile = nil;
48 return _loadingTile; 48 return _loadingTile;
49 49
50 RMTile t = RMTileDummy(); 50 RMTile t = RMTileDummy();
51 - NSString* file = [[NSBundle bundleForClass:@"RMTileProxy"] pathForResource:@"loading" ofType:@"png"]; 51 + NSString* file = [[NSBundle mainBundle] pathForResource:@"loading" ofType:@"png"];
52 _loadingTile = [[RMTileImage imageWithTile:t FromFile:file] retain]; 52 _loadingTile = [[RMTileImage imageWithTile:t FromFile:file] retain];
53 return _loadingTile; 53 return _loadingTile;
54 // return nil; 54 // return nil;
@@ -138,7 +138,7 @@ @@ -138,7 +138,7 @@
138 //CGAffineTransform transform = CGContextGetCTM(theContext); 138 //CGAffineTransform transform = CGContextGetCTM(theContext);
139 // RMLog(@"transform scale: a:%f b:%f c:%f d:%f tx:%f ty:%f", transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty); 139 // RMLog(@"transform scale: a:%f b:%f c:%f d:%f tx:%f ty:%f", transform.a, transform.b, transform.c, transform.d, transform.tx, transform.ty);
140 140
141 - NSString *path = [[NSBundle bundleForClass:@"RMTiledLayerController"] pathForResource:@"loading" ofType:@"png"]; 141 + NSString *path = [[NSBundle mainBundle] pathForResource:@"loading" ofType:@"png"];
142 CGDataProviderRef dataProvider = CGDataProviderCreateWithFilename([path UTF8String]); 142 CGDataProviderRef dataProvider = CGDataProviderCreateWithFilename([path UTF8String]);
143 CGImageRef image = CGImageCreateWithPNGDataProvider(dataProvider, NULL, FALSE, kCGRenderingIntentDefault); 143 CGImageRef image = CGImageCreateWithPNGDataProvider(dataProvider, NULL, FALSE, kCGRenderingIntentDefault);
144 CGDataProviderRelease(dataProvider); 144 CGDataProviderRelease(dataProvider);
@@ -18,6 +18,19 @@ @@ -18,6 +18,19 @@
18 18
19 - (void)performTest 19 - (void)performTest
20 { 20 {
  21 + NSLog(@"Frameworks");
  22 + NSArray *frameworks = [NSBundle allFrameworks];
  23 + for ( id oneFramework in frameworks ) {
  24 + NSLog ( @"%@", oneFramework );
  25 + }
  26 + NSLog(@"Bundles");
  27 + NSArray *bundles = [NSBundle allBundles];
  28 + for ( id oneBundle in bundles ) {
  29 + NSLog ( @"%@", oneBundle );
  30 + }
  31 + NSLog(@" [NSBundle bundleForClass:[mapContents class]] %@", [NSBundle bundleForClass:[upperMapContents class]]);
  32 +
  33 +
21 34
22 } 35 }
23 36