ユーザーが設定でロケーションの設定をいぢると、
didFailWit
が呼ばれる。Grant したときでさえも code = 0 で呼ばれる!
ユーザーが設定でロケーションの許可を与えなかったとき、だからといってstopUptati
1 - (void) 2 locationManager:(CLLocation Manager*)pLM 3 didFailWit hError:(NSError*)pError 4 { assert( [ pError.domain isEqual:kCLErrorDo main ] ); 5 switch ( pError.code ) 6 { 7 case 0: // User grant permission to access Location. 8 break; 9 case 1: // User change permittion to access Location to disabled, needs to uLocation be nil. 10 default: // But don't stop update location, you can't come back when user granted permission to access Location. 11 uLocation = nil; 12 break; 13 } 14 }
posted by
Saturn
on Mon 14 Apr 2014
at 17:44