Skip to content

Instantly share code, notes, and snippets.

@stevestreza
Created March 23, 2012 01:37
Show Gist options
  • Save stevestreza/2166072 to your computer and use it in GitHub Desktop.
Save stevestreza/2166072 to your computer and use it in GitHub Desktop.
How to add a Twitter username to an ABRecordRef
-(void)addContact{
ABRecordRef person;
ABMultiValueRef social = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType);
ABMultiValueAddValueAndLabel(social, [NSDictionary dictionaryWithObjectsAndKeys:
(NSString *)kABPersonSocialProfileServiceTwitter, kABPersonSocialProfileServiceKey,
@"justinbieber", kABPersonSocialProfileUsernameKey,
nil], kABPersonSocialProfileServiceTwitter, NULL);
ABRecordSetValue(person, kABPersonSocialProfileProperty, social, NULL);
CFRelease(social);
}
@Omarj
Copy link

Omarj commented Jan 30, 2013

NSLog(@"%ld", ABMultiValueGetCount(socialMulti)); return 0 value ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment