{"id":383,"date":"2015-03-09T11:33:53","date_gmt":"2015-03-09T03:33:53","guid":{"rendered":"http:\/\/www.yusian.com\/blog\/?p=383"},"modified":"2016-07-15T17:19:48","modified_gmt":"2016-07-15T09:19:48","slug":"%e5%a6%82%e4%bd%95%e5%88%a4%e6%96%ad%e5%bd%93%e5%89%8dapp%e6%98%af%e5%90%a6%e5%85%81%e8%ae%b8%e4%bd%bf%e7%94%a8%e7%b3%bb%e7%bb%9f%e5%ae%9a%e4%bd%8d%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/project\/2015\/03\/09\/113353383.html","title":{"rendered":"\u5982\u4f55\u5224\u65ad\u5f53\u524dApp\u662f\u5426\u5141\u8bb8\u4f7f\u7528\u7cfb\u7edf\u5b9a\u4f4d\u529f\u80fd"},"content":{"rendered":"<p>\u5982\u9898\u89e3\u7b54\uff1a\u5229\u7528CLLocationManager\u7684\u4e00\u4e2a\u7c7b\u65b9\u6cd5<\/p>\n<pre lang=\"objc\" line=\"1\">+ (CLAuthorizationStatus)authorizationStatus\n\/\/ CLAuthorizationStatus\u662f\u4e00\u4e2a\u679a\u4e3e\u503c\uff1a\ntypedef enum {\n    kCLAuthorizationStatusNotDetermined = 0, \/\/ User has not yet made a choice with regards to this application\n    kCLAuthorizationStatusRestricted,        \/\/ This application is not authorized to use location services.  Due\n                                             \/\/ to active restrictions on location services, the user cannot change\n                                             \/\/ this status, and may not have personally denied authorization\n    kCLAuthorizationStatusDenied,            \/\/ User has explicitly denied authorization for this application, or\n                                             \/\/ location services are disabled in Settings\n    kCLAuthorizationStatusAuthorized         \/\/ User has authorized this application to use location services\n} CLAuthorizationStatus;<\/pre>\n<p>\u6240\u4ee5\uff0c\u4e00\u5207\u53d8\u5f97\u7b80\u5355\u4e86<\/p>\n<pre lang=\"objc\" line=\"1\">\/\/ \u5224\u65ad\u672c\u5730\u5b9a\u4f4d\u670d\u52a1\u5f00\u542f\nif([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied){\n    \/\/ \u63d0\u793a\u7528\u6237\u5f00\u542f\u5b9a\u4f4d\u670d\u52a1\uff0cPS\uff1aiOS8\u7cfb\u7edf\u4f1a\u81ea\u52a8\u68c0\u6d4b\u989d\n    [SAAlertView showMessage:@\"\u8bf7\u5728\u7cfb\u7edf\u8bbe\u7f6e\u4e2d\u6253\u5f00\u201c\u5b9a\u4f4d\u670d\u52a1\u201d\u6765\u5141\u8bb8\u201cXXX\u201d\u786e\u5b9a\u60a8\u7684\u4f4d\u7f6e\"];\n}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u9898\u89e3\u7b54\uff1a\u5229\u7528CLLocationManager\u7684\u4e00\u4e2a\u7c7b\u65b9\u6cd5 + (CLAuthorizationStatus)authorizationStatus \/\/ CLAuthorizationStatus\u662f\u4e00\u4e2a\u679a\u4e3e\u503c\uff1a typedef enum { kCLAuthorizationStatusNotDetermined = 0, \/\/ User has not yet made a choice with regards to this application kCLAuthorizationStatusRestricted, \/\/ This application is not authorized to use location services. Due \/\/ to active restrictions on location services, the user cannot change \/\/ this status, and may not have personally [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[20],"class_list":["post-383","post","type-post","status-publish","format-standard","hentry","category-project","tag-basics"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/383","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=383"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/383\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=383"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=383"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=383"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}