- (BOOL)isLocationServicesEnabled
{
BOOL locationServicesEnabledInstancePropertyAvailable = [self.locationManager respondsToSelector:@selector(locationServicesEnabled)]; // iOS 3.x
BOOL locationServicesEnabledClassPropertyAvailable = [CLLocationManager respondsToSelector:@selector(locationServicesEnabled)]; // iOS 4.x
if (locationServicesEnabledClassPropertyAvailable) { // iOS 4.x
return [CLLocationManager locationServicesEnabled];
} else {
return NO;
}
}
الرسالة
This method can cause UI unresponsiveness if invoked on the main thread. Instead, consider waiting for the `-locationManagerDidChangeAuthorization:` callback and checking `authorizationStatus` first.
العمل اون لاين - زوم
السلام عليكم ورحمة الله وبركاته اهلا بك اخي الكريم راسلني مهندس برمجيات يمكنني تقديم المساعدة باذن الله