Skip to content

Commit

Permalink
improvements to asset assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
incanus committed Aug 20, 2012
1 parent 32a0bba commit 75bce17
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion MapView/Map/RMLoadingTileView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
6 changes: 6 additions & 0 deletions MapView/Map/RMMapView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 0 additions & 2 deletions MapView/Map/RMUserLocation.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions MapView/MapView_Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 75bce17

Please sign in to comment.