2014-09-25 49 views
2

我想讓我的應用程序獲取用戶的位置。 我做了一切從正確的答案從How to get Location user whith CLLocationManager in swift? 但CLAuthorizationStatus始終是CLAuthorizationStatus.NotDetermined 是什麼問題?Swift CLAuthorizationStatus始終是CLAuthorizationStatus.NotDetermined

+0

你有沒有解決過它? – longilong 2014-10-29 13:18:17

+0

是的。先加在plist文件 1)NSLocationWhenInUseUsageDescription 2)NSLocationAlwaysUsageDescription這兩個線路 - 從鏈接中我解決它的問題 – Farkhad 2014-10-30 07:04:05

+0

自己...我加了兩個按鍵在'plist'我的測試用例,而不是我的應用程序的'plist' – longilong 2014-10-30 08:26:43

回答

0

小心,

NSLocationAlwaysUsageDescription

NSLocationWhenInUseUsageDescription

鍵是強制的,所以你應該包括在你的plist。