新增目標c,我將ArcGIS用於地圖部分。我有一個問題,方法mapViewDidLoad
未被調用/加載。下面是代碼的某些部分:mapViewDidLoad方法未加載
.h文件中
@interface ViewController : UIViewController<AGSMapViewLayerDelegate, AGSMapViewTouchDelegate, AGSMapViewCalloutDelegate>{
AGSMapView *_mapView;
AppDelegate *appDelegate;
...
}
.m文件
- (void)viewDidLoad
{
[super viewDidLoad];
[self.activityView startAnimating];
self.mapView.touchDelegate = self;
self.mapView.calloutDelegate = self;
appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
...
}
- (void)mapViewDidLoad:(AGSMapView *)mapView {
AGSEnvelope *envelope = [[AGSEnvelope alloc]initWithXmin:29757.610204117
ymin:40055.0379682464
xmax:29884.6992302249
ymax:40236.6028660071
spatialReference:self.mapView.spatialReference];
[self.mapView zoomToEnvelope:envelope animated:YES];
self.mapView.callout.width = 195.0f;
self.mapView.callout.accessoryButtonHidden = YES;
[self.mapView.gps start];
[self.mapView centerAtPoint:self.mapView.gps.currentPoint animated:YES];
NSLog(@"Location : %@", self.mapView.gps.currentPoint);
[self.activityView stopAnimating];
self.activityView.hidden = YES;
}
什麼是錯我的代碼,爲什麼我不加載mapViewDidLoad
方法。 在此先感謝。
請確保您使mapview連接到插座並使其成爲委託=自我是文件擁有者在您的情況下 – 2012-08-06 07:28:35
yup出口mapView已經連接到文件所有者。我的每個插座都連接到他們的適當位置 – sihao 2012-08-06 07:31:13
並且mapview的代理也被分配給fileowner仔細檢查此步驟 – 2012-08-06 07:32:24