diff --git a/MapView/Map/RMLoadingTileView.m b/MapView/Map/RMLoadingTileView.m index 68169c709..5d249f6d7 100644 --- a/MapView/Map/RMLoadingTileView.m +++ b/MapView/Map/RMLoadingTileView.m @@ -21,7 +21,8 @@ - (id)initWithFrame:(CGRect)frame if (self) { - NSAssert([[NSBundle mainBundle] pathForResource:@"LoadingTile" ofType:@"png"], @"Unable to find necessary graphical assets (copy from framework 'Resources' folder)"); + RMRequireAsset(@"LoadingTile.png"); + RMRequireAsset(@"LoadingTileZoom.png"); _contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width * 3, frame.size.height * 3)]; [self addSubview:_contentView]; diff --git a/MapView/Map/RMMapView.m b/MapView/Map/RMMapView.m index 45506564f..f328dfb96 100644 --- a/MapView/Map/RMMapView.m +++ b/MapView/Map/RMMapView.m @@ -2638,6 +2638,12 @@ - (void)setShowsUserLocation:(BOOL)newShowsUserLocation if (newShowsUserLocation) { + RMRequireAsset(@"HeadingAngleSmall.png"); + RMRequireAsset(@"TrackingDot.png"); + RMRequireAsset(@"TrackingDotHalo.png"); + RMRequireAsset(@"TrackingHeading.png"); + RMRequireAsset(@"TrackingLocation.png"); + if (_delegateHasWillStartLocatingUser) [_delegate mapViewWillStartLocatingUser:self]; diff --git a/MapView/Map/RMUserLocation.m b/MapView/Map/RMUserLocation.m index 97b3c487f..0ed7d145f 100644 --- a/MapView/Map/RMUserLocation.m +++ b/MapView/Map/RMUserLocation.m @@ -21,8 +21,6 @@ - (id)initWithMapView:(RMMapView *)aMapView coordinate:(CLLocationCoordinate2D)a if ( ! (self = [super initWithMapView:aMapView coordinate:aCoordinate andTitle:aTitle])) return nil; - NSAssert([[NSBundle mainBundle] pathForResource:@"TrackingDot" ofType:@"png"], @"Unable to find necessary graphical assets (copy from framework 'Resources' folder)"); - layer = [[RMMarker alloc] initWithUIImage:[UIImage imageNamed:@"TrackingDot.png"]]; layer.zPosition = -MAXFLOAT + 2; diff --git a/MapView/MapView_Prefix.pch b/MapView/MapView_Prefix.pch index 1cb7c2ddc..435d71e54 100644 --- a/MapView/MapView_Prefix.pch +++ b/MapView/MapView_Prefix.pch @@ -24,3 +24,4 @@ #define NS_BLOCK_ASSERTIONS 1 #endif +#define RMRequireAsset(asset) NSAssert([[NSBundle mainBundle] pathForResource:[asset stringByReplacingOccurrencesOfString:[@"." stringByAppendingString:[asset pathExtension]] withString:@""] ofType:[asset pathExtension]], @"Unable to find %@ (copy from framework 'Resources' folder)", asset);