title: Updating the kABPersonPhoneProperty using an NSString to add a phone number
body: <p>I have a Contact object (a class that I wrote) that I want to use to create a new AddressBook person. Here is my code:</p>
  
  <pre><code>+ (ABRecordRef)createABPersonFromContact:(Contact*)contact
  {
      ABRecordRef person = ABPersonCreate();
  
      ABRecordSetValue(person, kABPersonFirstNameProperty, contact.firstName, NULL);
      ABRecordSetValue(person, kABPersonLastNameProperty, contact.lastName, NULL);
      ABRecordSetValue(person, kABPersonOrganizationProperty, contact.company, NULL);
  
      CFStringRef phoneNumberValue = (CFStringRef)contact.phoneNumber.value;
      CFStringRef phoneNumberLabel = (CFStringRef)contact.phoneNumber.label;
  
      ABMutableMultiValueRef phoneNumber = ABMultiValueCreateMutable(kABPersonPhoneProperty);
  
      ABMultiValueAddValueAndLabel(phoneNumber, value, label, NULL);
      ABRecordSetValue(person, kABPersonPhoneProperty, phoneNumber, NULL);
      CFRelease(phoneNumber);
  
      return person;
  }
  </code></pre>
  
  <p>contact.phoneNumber.value is an NSString in the format "555-555-5555". When I run the code and display an ABPersonViewController with the ABRecordRef returned by this method, every thing displays properly, but if I try to edit the phone number, the program crashes. I tried reformatting the NSString contact.phoneNumber.value to "(555) 555-5555" to match the style that the phone number is displayed in the ABPersonViewController, but it gave me the same result.</p>
  
  <p>Any suggestions as to why it is crashing?</p>