title: ABAddressBookGetPersonWithRecordID return nil
body: <p>My app stores the AddressBook recordIds of Contacts with the same name and later tries to present the addresses to the user to select the desired person. However, when I use the stored recordIds with ABAddressBookGetPersonWithRecordID, it returns nil.
  The code below represents the code project - I have "copied" the code that later tries to retrieve the Contact immediately below the code that stores the recordIds.</p>
  
  <pre><code>NSString *full = person.compositeName;
                  CFArrayRef contacts = ABAddressBookCopyPeopleWithName(addressBook, (__bridge        CFStringRef)(full));
                  CFIndex nPeople = CFArrayGetCount(contacts);
                  if (nPeople)
                  {
                      NSMutableArray *rIds = [[NSMutableArray alloc] init];
                      int numberOfContactsMatchingName = (int)CFArrayGetCount(contacts);
                      if (numberOfContactsMatchingName&gt;1)
                      {
                          for ( int i=0; i&lt;numberOfContactsMatchingName; ++i)
                          {
  
                              ABRecordID thisId = ABRecordGetRecordID(CFArrayGetValueAtIndex(contacts, i));
                              NSNumber *rid = [NSNumber numberWithInteger:thisId];
                              FLOG(@"%d Matched, this ID = %@", numberOfContactsMatchingName, rid);
                              [rIds addObject:rid];
                          }
  
  
                          for (int i=0; i&lt;rIds.count; ++i)
                          {
                              //contactRecord = ABAddressBookGetPersonWithRecordID(addressBook, (ABRecordID)recId);
                              ABRecordRef contactRecord;
                              contactRecord = ABAddressBookGetPersonWithRecordID(addressBook, rIds[i]);
                              if (contactRecord)
                              {
  
                              }
                              else
                              {
                                  FLOG (@"Noone found with recordId %@", rIds[i]);
                              }
                          }
  </code></pre>
  
  <p>So, for example, I just ran this, and it found two Contacts in the address book with the same name - with ids 143 and 305, but when I then tried ABAddressBookGetPersonWithRecordID with ids 143 and 305, both returned nil.
  What have I got wrong here?</p>