我想跟踪当前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