我收到以下錯誤:TWTRLogInButton - NSURLErrorDomain錯誤-1012
error: The operation couldn’t be completed. (NSURLErrorDomain error -1012.)
當我按下出現在控制檯此錯誤「登錄與Twitter」按鈕,這是像這樣(正是因爲它創建出現在應用程序中):
TWTRLogInButton* logInButton = [TWTRLogInButton buttonWithLogInCompletion:^(TWTRSession* session, NSError* error) {
if (session) {
NSLog(@"signed in as %@", [session userName]);
} else {
NSLog(@"error: %@", [error localizedDescription]);
}
}];
我沒有看到NSLog的錯誤或'登錄爲%@'。
在運行iOS 9.1的iPhone 6S上運行應用程序時發生該錯誤。
結構是最新版本1.12.0。不過,我有以下警告:
Umbrella header for module 'TwitterKit' does not include header 'TWTRDefines.h'
Umbrella header for module 'TwitterKit' does not include header 'TWTRSession.h'
我不確定他們是否是造成問題的原因 - 但持懷疑態度它運行在模擬器和其他設備。
在手機的開發人員設置中,我已將「允許HTTP服務」設置爲ON,並在my.plist文件中設置了允許任意鍵爲YES的鍵,因爲這似乎解決了以前的問題。
任何意見將不勝感激,因爲我真的迷路了。
也許這將有助於http:// stackoverflow。com/questions/25372318/error-domain-nsurlerrordomain-code-1005-the-network-connection-was-lost/25996971#25996971 – SeanChense
這看起來很奇怪。你是否刪除了應用程序並清理了構建文件夾? – Moose
沒有運氣清理生成文件夾。 @SeanChense,也沒有工作,但謝謝你的建議。 –