Created
March 23, 2012 01:37
-
-
Save stevestreza/2166072 to your computer and use it in GitHub Desktop.
How to add a Twitter username to an ABRecordRef
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NSLog(@"%ld", ABMultiValueGetCount(socialMulti)); return 0 value ???