sample code..
//add work adress ABMutableMultiValueRef multiAddress1 = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType); NSMutableDictionary *addressDictionary1 = [[NSMutableDictionary alloc] init]; if(address1_street) [addressDictionary1 setObject:address1_street forKey:(NSString *) kABPersonAddressStreetKey]; if(address1_city) [addressDictionary1 setObject:address1_city forKey:(NSString *)kABPersonAddressCityKey]; if(address1_state) [addressDictionary1 setObject:address1_state forKey:(NSString *)kABPersonAddressStateKey]; if(address1_postalcode) [addressDictionary1 setObject:address1_postalcode forKey:(NSString *)kABPersonAddressZIPKey]; if(address1_country) [addressDictionary1 setObject:address1_country forKey:(NSString *)kABPersonAddressCountryKey]; ABMultiValueAddValueAndLabel(multiAddress1, addressDictionary1, kABWorkLabel, NULL); [addressDictionary1 release]; ABRecordSetValue(aRecord, kABPersonAddressProperty, multiAddress1, &anError); CFRelease(multiAddress1);
No comments:
Post a Comment