2016-11-25 26 views
2

當我點擊設置關於頁上,將顯示一條錯誤消息:不能跳轉到系統設置頁面

2016-11-25 19:49:04.352 ass176[4729:186745] -canOpenURL: failed for URL: "prefs:root=General&path=About" - error: "The operation couldn’t be completed. (OSStatus error -10814.)" 

這是代碼:

let url = URL(string: "prefs:root=General&path=About") 

if UIApplication.shared.canOpenURL(url!){ 
    UIApplication.shared.open(url!, options: [:], completionHandler: nil) 
} 

環境:iOS版10.1,8.1的XCode

enter image description here

+3

開幕首選項從自己的應用程序設置的URL一邊是不允許的,並會導致對私有API使用的拒絕 – Paulw11

回答

1

顯然,這是不允許的。您必須將UIApplicationOpenSettingsURLString用於您自己的應用設置。

您可以閱讀@ Paulw11回答這裏: Answer

0

錯誤代碼10814告知。

No application in the Launch Services database matches the input criteria. 

您可以通過link

我更喜歡的解決辦法是嘗試重置模擬器得到它。並重新運行該項目。