gpt4 book ai didi

iphone - accountTypeWithAccountTypeIdentifier 未完成

转载 作者:可可西里 更新时间:2023-11-01 06:15:42 27 4
gpt4 key购买 nike

我正在尝试访问 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 行没有返回。我已经尝试在主线程和后台线程中运行它,但无济于事。

最佳答案

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

关于iphone - accountTypeWithAccountTypeIdentifier 未完成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18232677/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com