初始化location Manager:
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.delegate = self;
[self.locationManager startMonitoringSignificantLocationChanges];
在ios6中,創建之後,當前的location就會調用delegates
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
但是在ios5中測試的時候,delegates就沒有被調用。
為什麼?
謝謝
問題是方法:
- (void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
是iOS6新的, 在iOS5中需要使用:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocatio