我知道这很简单,我忽略了但我不能为我的生活弄清楚出了什么问题。任何人都可以对这种情况有所了解吗?非常感谢。
#import "OnlineLayerViewController.h"
#import "MapBox.h"
#define kNormalMapID @"ianbruton.map-8uhua25t"
#define kRetinaMapID @"ianbruton.map-8uhua25t"
@implementation OnlineLayerViewController
- (void)viewDidLoad
{
[super viewDidLoad];
RMMapBoxSource *onlineSource = [[RMMapBoxSource alloc] initWithMapID:(([[UIScreen mainScreen] scale] > 1.0) ? kRetinaMapID : kNormalMapID)];
RMMapView *mapView = [[RMMapView alloc] initWithFrame:self.view.bounds andTilesource:onlineSource];
//THIS IS WHERE I'M GETTING THE ERROR
[showDevicePosition : mapView];
mapView.zoom = 14;
mapView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
//makes place names legible on retina devices
mapView.adjustTilesForRetinaDisplay = YES;
//Creates a point to draw
RMPointAnnotation *annotation = [[RMPointAnnotation alloc] initWithMapView:mapView
coordinate:mapView.centerCoordinate
andTitle:@"Hello, world!"];
//Draws point
[mapView addAnnotation:annotation];
[self.view addSubview:mapView];
}
//THIS IS THE METHOD I'M TRYING TO CALL
- (void)showDevicePosition : (RMMapView *) mapView
{
mapView.centerCoordinate = mapView.userLocation.location.coordinate;
}
@end