[_accountStore requestAccessToAccountsWithType: ...] を実行すると、応答がありません。完了ハンドラが呼び出されていません。ただし、Twitterにはアクセスできます。
// Step 0: Check that the user has local Twitter accounts
if ([SLComposeViewController
isAvailableForServiceType:SLServiceTypeTwitter]) {
NSLog(@"OH YES!!!");
// Step 1: Obtain access to the user's Twitter accounts
ACAccountType *twitterAccountType = [_accountStore accountTypeWithAccountTypeIdentifier: ACAccountTypeIdentifierTwitter];
NSLog(@"OH YES!!!");
[_accountStore requestAccessToAccountsWithType:twitterAccountType options:nil
completion:^(BOOL granted, NSError *error)
{
NSLog(@"Im in!");
if (granted == YES)
{
NSArray *arrayOfAccounts = [_accountStore
accountsWithAccountType:twitterAccountType];
if ([arrayOfAccounts count] > 0)
{
ACAccount *twitterAccount = [arrayOfAccounts lastObject];
NSLog(@"%@", twitterAccount.userFullName);
NSLog(@"%@", twitterAccount.username);
NSLog(@"%@", twitterAccount.credential);
NSLog(@"%@", twitterAccount.identifier);
}
}else{
NSLog(@"Failed muahahaha");
}
}];
}
なぜこうなった?