2013-12-11 17 views
0

在某些較舊設備的主線程上調用[CLLocationManager authorizationStatus]時,偶爾會看到明顯的UI凍結。這是否應該發生?我沒有看到任何的文件中表示,這是比獲得一個狀態變量調用[CLLocationManager authorizationStatus]時出現意外延遲/滯後/凍結/阻塞

文檔更多:在iPhone 4S https://developer.apple.com/library/mac/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/occ/clm/CLLocationManager/authorizationStatus

問題明顯運行iOS 7.0.4

+0

你有沒有找到解決這個問題(除了調度到後臺線程)? – bcherry

+0

不,我現在將它移到了後臺線程。希望能儘快解決問題。 – Mike

回答

0

我有同樣的問題。我仍然不知道這是什麼原因,但我的快速解決方案是把它放到這樣的線程:

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 
    if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized) { 
     // Do something... 
    } 
}); 

我希望這可以幫助。