title: How to add information to a contact already existing in iPhone
body: <p>How to add information to a contact already existing in iPhone?</p>
  
  <p>I have worked with such information, but I have not figured out how to add information to existing contacts.</p>
  
  <pre><code> ABUnknownPersonViewController *unknownPersonViewController = [[ABUnknownPersonViewController alloc] init];
              unknownPersonViewController.displayedPerson = (ABRecordRef)[self buildContactDetails];
              unknownPersonViewController.allowsAddingToAddressBook = YES;
              [self.navigationController pushViewController:unknownPersonViewController animated:YES];
              [unknownPersonViewController release]; 
  
  
      - (ABRecordRef)buildContactDetails {
      NSLog(@"building contact details");
      ABRecordRef person = ABPersonCreate(); 
      CFErrorRef  error = NULL;  
  
      // firstname
  
  
      int i ; int taille ; 
      taille = [carte.informations count];
      NSString *nom=nil ;
      NSString *adresse=nil ;
      NSString *mail=nil,*prenom=nil,*tel=nil,*societe=nil,*profession=nil; 
  
  
      for (i=0; i&lt;taille; i++) {
  
          if ([(Information*)[self.carte.informations objectAtIndex:i] label]==1) {
              nom = [(Information*)[self.carte.informations objectAtIndex:i] content];
          }
          else  if([(Information*)[self.carte.informations objectAtIndex:i] label]==2) {
              prenom=[(Information*)[self.carte.informations objectAtIndex:i] content];
  
          }
          else if([(Information*)[self.carte.informations objectAtIndex:i] label]==3){
  
              tel=[(Information*)[self.carte.informations objectAtIndex:i] content];
  
          }
  
          else if([(Information*)[self.carte.informations objectAtIndex:i] label]==4){
  
              societe=[(Information*)[self.carte.informations objectAtIndex:i] content];
          }       
          else if([(Information*)[self.carte.informations objectAtIndex:i] label]==5) {
  
              adresse = [(Information*)[self.carte.informations objectAtIndex:i] content];
  
          }
          else if ([(Information*)[self.carte.informations objectAtIndex:i] label]==6){
              mail = [(Information*)[self.carte.informations objectAtIndex:i] content];
  
  
          }
          else if ([(Information*)[self.carte.informations objectAtIndex:i] label]==7){
              profession = [(Information*)[self.carte.informations objectAtIndex:i] content];
  
  
          }
  
  
      }
  
  
  
  
      if(nom != nil &amp;&amp; (![nom isEqualToString:@""])){
      ABRecordSetValue(person, kABPersonFirstNameProperty,nom, NULL);
      }
  
      if (prenom != nil &amp;&amp; (![prenom isEqualToString:@""])) {
      ABRecordSetValue(person, kABPersonLastNameProperty, prenom, NULL);
      }
  
            if(mail != nil &amp;&amp; (![mail isEqualToString:@""])){
         ABMutableMultiValueRef email = ABMultiValueCreateMutable(kABMultiStringPropertyType);
      ABMultiValueAddValueAndLabel(email, mail, CFSTR("email"), NULL);
      ABRecordSetValue(person, kABPersonEmailProperty, email, &amp;error);
      CFRelease(email); 
            }
  
  
  
  
      //Phone 
       if(tel != nil &amp;&amp; (![tel isEqualToString:@""])){
      ABMutableMultiValueRef Phone = ABMultiValueCreateMutable(kABMultiStringPropertyType);
      ABMultiValueAddValueAndLabel(Phone, tel, CFSTR("Phone"), NULL);
      ABRecordSetValue(person,kABPersonPhoneProperty, Phone, &amp;error);
      CFRelease(Phone); 
       }
  
  
          if(adresse != nil &amp;&amp; (![adresse isEqualToString:@""])){
      // Start of Address
      ABMutableMultiValueRef address = ABMultiValueCreateMutable(kABMultiDictionaryPropertyType);  
      NSMutableDictionary *addressDict = [[NSMutableDictionary alloc] init];
      [addressDict setObject:adresse forKey:(NSString *)kABPersonAddressStreetKey];   
       //[addressDict setObject:@"0568" forKey:(NSString *)kABPersonAddressZIPKey];  
       //[addressDict setObject:@"Oslo" forKey:(NSString *)kABPersonAddressCityKey]; 
         ABMultiValueAddValueAndLabel(address, addressDict, kABWorkLabel, NULL);
      ABRecordSetValue(person, kABPersonAddressProperty, address, &amp;error); 
        [addressDict release];
        CFRelease(address); 
        // End of Address
  }
                if (error != NULL) 
            NSLog(@"Error: %@", error);
  
      [(id)person autorelease];
      return person;
  }
  
  
    - (void)newPersonViewController:(ABNewPersonViewController *)newPersonView          didCompleteWithNewPerson:(ABRecordRef)person{}
  </code></pre>
  
  <p>I have done like that in this example that I can add a new contact with my information but I can not for example add information for existing contacts</p>