【发布时间】: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