accountTypeWithAccountTypeIdentifier not finishing

445 Views Asked by At

I'm attempting to access Twitter accounts, but this code is halting on the line accountTypeWithAccountTypeIdentifier.

My code looks like this, i'm running 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");

I get NSLogs 1 and 2, which means the accountTypeWithAccountTypeIdentifier line isn't returning. I've tried running this both on the main thread and in a background thread, to no avail.

1

There are 1 best solutions below

0
On

It's very likely that you've forgotten to add Accounts.framework to your project. (This solved the same problem for me)