IOS9中还得加入如下设置项: (CLLocationManager *)sharedLocationManager { static CLLocationManager *_locationManager; @synchronized(self) { if (_locationManager == nil) { _locationManager = [[CLLocationManager alloc] init]; if ([_locationManager respondsToSelector:@selector(allowsBackgroundLocationUpdates)]) { [_locationManager setAllowsBackgroundLocationUpdates:YES]; } _locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation; } } return _locationManager; }
29,028
社区成员
12,466
社区内容
加载中
试试用AI创作助手写篇文章吧