title: How to add address properties in Address Book?
body: <p>I'm trying to add new contact to the <code>iPhone</code> Address book using <code>ABAddressBook</code>. Adding first/last name works fine, but I get errors when I'm trying to add country, street, city, etc. I get an error when I use <code>kABPersonAddressCountryCodeKey</code> or <code>kABPersonAddressCountryKey</code>. </p>
  
  <pre><code>func addUserToAddressBook(){
      let stat = ABAddressBookGetAuthorizationStatus()
      switch stat {
      case .Denied, .Restricted:
          print("no access to addressbook")
      case .Authorized, .NotDetermined:
          var err : Unmanaged&lt;CFError&gt;? = nil
          let adbk : ABAddressBook? = ABAddressBookCreateWithOptions(nil, &amp;err).takeRetainedValue()
          if adbk == nil {
              print(err)
              return
          }
          ABAddressBookRequestAccessWithCompletion(adbk) {
              (granted:Bool, err:CFError!) in
              if granted {
                  let newContact:ABRecordRef! = ABPersonCreate().takeRetainedValue()
                  var success:Bool = false
  
                  //Updated to work in Xcode 6.1
                  var error: Unmanaged&lt;CFErrorRef&gt;? = nil
  
                  success = ABRecordSetValue(newContact, kABPersonFirstNameProperty, self.userFirstName. , &amp;error)
                  print("Setting first name was successful? \(success)")
                  success = ABRecordSetValue(newContact, kABPersonLastNameProperty, self.user.LastName, &amp;error)
                  print("Setting last name was successful? \(success)")
  
                  // Address??????
                  success = ABRecordSetValue(newContact, kABPersonAddressCountryCodeKey, self.user.CountryCode, &amp;error) // self.user.CountryCode = "CN" - Receive an error 
  
                  success = ABAddressBookAddRecord(adbk, newContact, &amp;error)
                  print("Contact added successful? \(success)")
                  success = ABAddressBookSave(adbk, &amp;error)
                  print("Saving addressbook successful? \(success)")
  
              } else {
                  print(err)
              }
          }
      }
  
  }
  </code></pre>
  
  <p>Does anyone know how I can fix this issue?</p>