If I access Twitter, I would prefer to use the automatic alert box asking that the user go to settings, yet can't get it to work and provide my own default dialog, which I really don't want to do.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"indexPath.row %i", indexPath.row);
if (indexPath.row == 0) {
store = [[ACAccountStore alloc] init]; // Long-lived
twitterType = [store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[store requestAccessToAccountsWithType:twitterType withCompletionHandler:^(BOOL granted, NSError *error) {
if (granted) {
// Access has been granted, now we can access the accounts
twitterAccounts = [store accountsWithAccountType:twitterType];
if (twitterAccounts.count == 1) {
[self getTwitterData:[twitterAccounts objectAtIndex:0]];
} else {
[self selectTwitterAccount];
}
} else {
// Prefer NOT to do this ************************************
[self performSelectorOnMainThread:@selector(showTwitterError) withObject:nil waitUntilDone:NO];
}
}];
}