iphone - check for locationServicesEnabled always returns YES, Irrespective of manual toggle switch to decide if location services are enabled -


  स्थान = [[CLLocationManager alloc] init]; Location.desiredAccuracy = केसीएललोकेशनलताबैस्टफॉरेवलैक्शन; Location.distanceFilter = 10; location.delegate = आत्म; LocationEnabledBool = [CLLocationManager स्थान सेवाएँसक्रिय]; If (locationEnabledBool == NO) {UIAlertView * locationAlert = [[UIAlertView alloc] initWithTitle: @ "स्थान सेवा अक्षम" संदेश: @ "पुनः सक्षम करने के लिए, कृपया सेटिंग्स पर जाएं और इस ऐप के लिए स्थान सेवा चालू करें।" प्रतिनिधि: शून्य रद्द करेंट्यूटनटाइट: @ "ओके" अन्य बटनटाइटल्स: शून्य]; [स्थान अलर्ट शो]; [स्थानअलार्ट रिलीज़]; } और [स्थान प्रारंभ करना स्थान स्थान];   

locationEnabledBool का मान हमेशा हाँ है, यह अलग है कि स्थान सेवाएं सक्षम हैं या नहीं।

  = NO) {// त्रुटि संदेश}   

प्रयास करें

  यदि ([CLLocationManager locationServicesEnabled] == नहीं || [CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied ) {// त्रुटि संदेश दें}   

मुझे लिंक पर यह मिला



Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -