AccountTypeWithAccountTypeIdentifier does not end

I am trying to access Twitter accounts, but this code stops at the line accountTypeWithAccountTypeIdentifier .

My code looks like this: I am 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 that the line accountTypeWithAccountTypeIdentifier is not returned. I tried to run this both in the main thread and in the background thread, but to no avail.

+4
source share
1 answer

Most likely, you forgot to add Accounts.framework to your project. (This solved the same problem for me)

0
source

Source: https://habr.com/ru/post/1497024/


All Articles