Ios8之後, 定位的delegate不能觸發的問題

FlyLolo發表於2015-04-21
if([CLLocationManager locationServicesEnabled]){  
  self.locationManage = [[[CLLocationManager alloc] init] autorelease];  
  self.locationManage.delegate = self;  
  self.locationManage.distanceFilter = 200;  
  self.locationManage.desiredAccuracy = kCLLocationAccuracyBest;  
}
if (SYSTEM_VERSION >= 8.0) {  
    [self.locationManage requestWhenInUseAuthorization];// <span style="font-family: Arial, Helvetica, sans-serif;">requestAlwaysAuthorization</span>  }
<span style="font-family: Arial, Helvetica, sans-serif;">     }</span><span style="font-family: Arial, Helvetica, sans-serif;">  
</span>} 

Ios8之後, 定位的delegate不能觸發的問題。

1. 需要新增如上的判斷中的授權語句。

2. plist中新增鍵NSLocationAlwaysUsageDescription 和 NSLocationWhenInUseUsageDescription 

相關文章