Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
ACAccountStore *as = [[ACAccountStore alloc] init];
[self setAccountStore:as];
ACAccountType *twitterAccountType = [[self accountStore] accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[[self accountStore] requestAccessToAccountsWithType:twitterAccountType
withCompletionHandler:^(BOOL granted, NSError *error) {
if ( granted == NO ) {
[self showNoTwitterAccountAlert];
NSArray *twitterAccounts = [[self accountStore] accountsWithAccountType:twitterAccountType];
if ( [twitterAccounts count] > 0 ) {
[self setTwitterAccount:[twitterAccounts lastObject]];
[self retrieveIDs];
} else {
[self showNoTwitterAccountAlert];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment