IOS Twitter sdk错误

时间:2015-09-04 05:59:07

标签: ios twitter sdk

您好我刚刚向Twitter开发者添加了一个应用程序。 我添加了" Consumer Key" & "消费者秘密" 到IOS app。

我一直在使用parse框架将PFUser帐户链接到twitter。

参考下面的代码: -

- (IBAction)actionLinkTwitter:(UIButton *)sender
{
if (!sender.selected) { // not linked, link it!
    [PFTwitterUtils linkUser:[PFUser currentUser] block:^(BOOL succeeded, NSError *error) {
        if (succeeded) {
            NSLog(@"User linked their Twitter account!");
            sender.selected = YES;
        }
        else
        {
            NSLog(@"%@",error.description);
        }
    }];
} else { // linked, unlink it!
    [PFTwitterUtils unlinkUserInBackground:[PFUser currentUser] block:^(BOOL succeeded, NSError *error) {
        if (succeeded) {
            NSLog(@"The user is no longer associated with their Twitter account.");
            sender.selected = NO;
        }
        else
        {
            NSLog(@"%@",error.description);
        }
    }];
}

}

但每次发生错误。 请参阅以下错误详情: -

错误域= NSURLErrorDomain代码= -1012"操作无法完成。 (NSURLErrorDomain错误-1012。)" UserInfo = 0x7b6c8160 {NSErrorFailingURLKey = https://api.twitter.com/oauth/request_token,NSErrorFailingURLStringKey = https://api.twitter.com/oauth/request_token,NSUnderlyingError = 0x7c025a60"操作无法完成。 (kCFErrorDomainCFNetwork错误-1012。)"}

0 个答案:

没有答案