我想跟蹤當前location..I使用TIS代碼來跟蹤它的緯度和經度座標...跟蹤當前位置的座標共同
-(void)ViewDidLoad{
map = [[MKMapView alloc] initWithFrame:CGRectMake(0,46,320,370)];
[map setDelegate:self];
map.showsUserLocation=YES;
[map setZoomEnabled:YES];
[self.view addSubview:map];
[map setMapType:MKMapTypeStandard];
[self locationManager:locationManager didUpdateToLocation:newlocation fromLocation:oldlocation];}
- (void)locationManager:(CLLocationManager *)managerdidUpdateToLocation:(CLLocation *)NewLocation
fromLocation:(CLLocation *)OldLocation
{
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
[locationManager startUpdatingLocation];
NSLog(@"%f %f",locationManager.location.coordinate.latitude,locationManager.location.coordinate.latitude);
}
但我的應用程序崩潰, 我的日誌報告:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Map locationManager:didUpdateToLocation:fromLocation:]: unrecognized selector sent to instance 0x5863890'
感謝烏爾rply ...但伊茨撞毀我的應用程序.. – Icoder 2011-12-15 10:03:57
任何崩潰信息/異常。 ..? – 2011-12-15 10:13:23
終止應用程序由於未捕獲的異常「NSInvalidArgumentException」,原因是:「 - [地圖的LocationManager:didUpdateToLocation:fromLocation:]:無法識別的選擇發送到實例0x5863890」 這是我崩潰報告 – Icoder 2011-12-15 10:23:26