【问题标题】:accountTypeWithAccountTypeIdentifier not finishingaccountTypeWithAccountTypeIdentifier 未完成
【发布时间】:2013-08-16 11:04:21
【问题描述】:

我正在尝试访问 Twitter 帐户,但此代码在 accountTypeWithAccountTypeIdentifier 行停止。

我的代码如下所示,我运行的是 iOS 6:

#import <Accounts/Accounts.h>
#import <Social/Social.h>
#import <Twitter/Twitter.h>

NSLog(@"1");
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
NSLog(@"2");
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
NSLog(@"3");
[accountStore requestAccessToAccountsWithType:accountType options:nil completion:^(BOOL granted, NSError *error) {

    NSLog(@"5");

}];
NSLog(@"4");

我得到 NSLogs 1 和 2,这意味着 accountTypeWithAccountTypeIdentifier 行没有返回。我已经尝试在主线程和后台线程中运行它,但无济于事。

【问题讨论】:

  • 这是什么?请详细说明问题。

标签: iphone ios objective-c twitter social-framework


【解决方案1】:

您很可能忘记将 Accounts.framework 添加到您的项目中。 (这为我解决了同样的问题)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-10-19
    • 2017-08-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多