1
我目前正在使用Map功能,並獲取當前位置並顯示。現在,我在iOS4中運行我的應用程序。在iOS4中運行應用程序時,無法調用委託方法。但是我可以在舊版本的Xcode 3.1.4中運行我的應用程序。它工作正常,委託方法也正確調用。那麼我怎樣才能在iOS4中調用CLLocationManger委託方法?它對我來說很奇怪。CLLocationManager委託方法不在iOS4中調用
- (void)locationManager: (CLLocationManager *)manager didUpdateToLocation: (CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSLog(@"inside didUpdateToLocation");
MKCoordinateRegion region1;
region1.center = newLocation.coordinate;
region1.span.latitudeDelta = 0.001;
region1.span.longitudeDelta = 0.001;
mapview.mapType = MKMapTypeStandard;
[mapview setRegion:region1 animated:TRUE];
[locationManager stopUpdatingLocation];
}
請幫我一把。
謝謝。