iOS Twitter NSURLErrorDomain 代码=-1012 [英] iOS Twitter NSURLErrorDomain Code=-1012

查看:101
本文介绍了iOS Twitter NSURLErrorDomain 代码=-1012的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过在我的应用中使用 twitter 来获取用户的详细联系信息.我在 github 上找到了 this 项目,这看起来非常好.我只遇到一个问题.如果我使用来自 twitter 的新应用程序消费者密钥和消费者密钥代码运行它,它会给我一个错误:

I am trying to get the user's contact details by singning up with twitter in my app. I found this project on github which seems really good. I encounter only one problem. If I run it with my new app consumer secret and consumer key codes from twitter it gives me an error :

Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x6898e80 {NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token, NSErrorFailingURLStringKey=https://api.twitter.com/oauth/request_token, NSUnderlyingError=0x68980e0 "The operation couldn’t be completed. (kCFErrorDomainCFNetwork error -1012.)"}

控制台的输出是:

2013-01-16 17:55:24.367 DMTwitterOAuth[3411:c07] current status = Prompt for user data and request token to server
2013-01-16 17:55:24.371 DMTwitterOAuth[3411:c07] current status = Requesting token for current user's auth data...
2013-01-16 17:55:25.433 DMTwitterOAuth[3411:c07] current status = Token received from server

在我收到警报视图后立即显示它遇到了 NSURLErrorDomain.

Immediately after I get the alert view in which it says that it encountered a NSURLErrorDomain.

另一方面,如果我使用来自另一个 twitter 应用程序的其他代码运行它,它会工作,为我提供有关用户的所有详细信息.我只是不明白为什么对于某些键它有效,而对于其他一些键则不起作用.

On the other hand, if I run it with some other codes from another twitter app it works, giving me all the details about the user. I just can't understand why for some keys it works, and for some others it doesn't.

推荐答案

错误代码 -1012kCFURLErrorUserCancelledAuthentication.这应该意味着某些代码在某处称为 [sender cancelAuthenticationChallenge:] 以响应身份验证质询.这可能是 DMTwitterOAuth 中的代码,但也可能是 Apple 在 URL 加载系统中自己的代码.

Error code -1012 is kCFURLErrorUserCancelledAuthentication. This should mean that some code somewhere called [sender cancelAuthenticationChallenge:] in response to an authentication challenge. This is likely code inside of DMTwitterOAuth, but it's also possible it's Apple's own code inside the URL-loading system.

这篇关于iOS Twitter NSURLErrorDomain 代码=-1012的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆