Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 0.85 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Add contact from iPhone application bugg
  2. ABAddressBookRef addressBook = ABAddressBookCreate();
  3.     ABRecordRef Showroom = ABPersonCreate();
  4. ABMutableMultiValueRef multiAddress = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType);
  5.     NSMutableDictionary *addressDictionary = [[NSMutableDictionary alloc] init];
  6.     [addressDictionary setObject:[NSString stringWithFormat:@"%@",Address_Bcard.text] forKey:(NSString *) kABPersonAddressStreetKey];
  7.  
  8.     ABMultiValueAddValueAndLabel(multiAddress, addressDictionary, kABWorkLabel, NULL);
  9.     ABRecordSetValue(Showroom, kABPersonAddressProperty, multiAddress,@"");
  10.     CFRelease(multiAddress);
  11.  
  12.     ABAddressBookAddRecord(addressBook, Showroom, nil);
  13.     ABAddressBookSave(addressBook, nil)
  14. CFRelease(Showroom);
  15. CFRelease(addressBook);
  16.        
  17. Settings -> General -> International -> Region Format to "Australia".