Skip to content

Instantly share code, notes, and snippets.

@samsoir
Created November 8, 2012 05:00
Show Gist options
  • Save samsoir/4036885 to your computer and use it in GitHub Desktop.
Save samsoir/4036885 to your computer and use it in GitHub Desktop.
Problem code abstract
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SCContactPerson *contactPerson = [self.contactSelectionTableDataArray objectAtIndex:indexPath.row];
[self decorateContactPerson:contactPerson fromFbUser:self.userDict];
[contactPerson updateRecord:contactPerson.ABRecordID error:nil];
if ([contactPerson ABRecordID] == kABRecordInvalidID)
{
ABAddressBookRef addressBook = SCAddressBookCreate(NULL, NULL);
ABRecordRef addressBookRecord = [self copyPersonRecordRefFrom:contactPerson];
UINavigationController *navigationController = [[[UINavigationController alloc]
initWithRootViewController:[self newPersonViewControllerFor:addressBookRecord withAddressBook:addressBook]] autorelease];
[self.navigationController presentViewController:navigationController animated:YES completion:^{
}];
CFRelease(addressBookRecord);
CFRelease(addressBook);
}
else
{
[self contactPersonSelected:contactPerson];
}
[[tableView cellForRowAtIndexPath:indexPath] setSelected:NO animated:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment