相关疑难解决方法(0)

尝试使用新的iOS 5 API在Twitter上"关注"某人,获得406返回错误.为什么?

尝试使用新的iOS 5 API在Twitter上"关注"某人,获得406返回错误.为什么?

我的代码是否正确?需要找出为什么这不起作用....

    - (void)followOnTwitter:(id)sender
{
    ACAccountStore *accountStore = [[ACAccountStore alloc] init];

ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];

[accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
    if(granted) {
        // Get the list of Twitter accounts.
        NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];

        // For the sake of brevity, we'll assume there is only one Twitter account present.
        // You would ideally ask the user which account they want to tweet from, if there is more than one Twitter account present.
        if ([accountsArray count] …
Run Code Online (Sandbox Code Playgroud)

iphone twitter cocoa-touch objective-c ios5

28
推荐指数
2
解决办法
8284
查看次数

标签 统计

cocoa-touch ×1

ios5 ×1

iphone ×1

objective-c ×1

twitter ×1