2010-07-07 65 views
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]; 

} 

请帮我一把。

谢谢。

回答

0

打开机场,现在似乎工作正常。非常奇怪....

这也是之前报道的Xcode 3.1.3。但是从现在起我总是在模拟器上使用3.1.2。 当我更新到iOS4时,出现了这个问题。非常讨厌....

相关问题