我使用iPhone SDK 4.0.I已经使用下面的代码采取现在的位置,但它的委托方法是不是叫自动...我的代码如下:为什么在iOS4.0中不调用委托CurrentLotion的方法(CLLocationManager)?
在.hfile
我有进口
CoreLocation/CoreLocation.h
也委派
CLLocationManagerDelegate
CLLocationManager * locationManager;
在.mfilelocationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.distanceFilter = kCLDistanceFilterNone; // whenever we move
locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; // 100 m
[locationManager startUpdatingLocation];
,但我不明白的是,当前的位置......我的委托方法是不叫:
- (无效)的LocationManager (CLLocationManager *)经理 didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
尝试安装到iphone上,因为代码看起来没问题。 – mrugen 2011-06-22 05:58:24