iOS Twitter NSURLErrorDomain 代码=

编程入门 行业动态 更新时间:2024-10-19 07:36:31
本文介绍了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=api.twitter/oauth/request_token, NSErrorFailingURLStringKey=api.twitter/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.

推荐答案

错误代码 -1012 是 kCFURLErrorUserCancelledAuthentication.这应该意味着某些代码在某处称为 [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 代码=

本文发布于:2023-11-26 18:16:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634652.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:代码   iOS   Twitter   NSURLErrorDomain

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!