title: How do I get a list of the user's contacts in iOS 6?
body: <p>I have been using the following code for a few years now and it has always worked, but it looks like with iOS 6 it doesn't anymore. How do I get a list of all contacts on an iOS 6 device?</p>
  
  <pre><code>ABAddressBookRef myAddressBook = ABAddressBookCreate();
          NSMutableArray *people = (__bridge_transfer NSMutableArray *)ABAddressBookCopyArrayOfAllPeople(myAddressBook);
          CFRelease(myAddressBook);
  
          // repeat through all contacts in the inital array we loaded
          for(int i=0; i&lt;[people count]; i++)
          {
              NSString *aName;
              NSString *firstName = (__bridge_transfer NSString *)ABRecordCopyValue((__bridge ABRecordRef)([people objectAtIndex:i]), kABPersonFirstNameProperty);
              NSString *lastName = (__bridge_transfer NSString *)ABRecordCopyValue((__bridge ABRecordRef)([people objectAtIndex:i]), kABPersonLastNameProperty);
  
              if (([firstName isEqualToString:@""] || [firstName isEqualToString:@"(null)"] || firstName == nil) &amp;&amp;
                  ([lastName isEqualToString:@""] || [lastName isEqualToString:@"(null)"] || lastName == nil))
              {
                  // do nothing
              }
              else 
              {
                  aName = [NSString stringWithFormat:@"%@ %@", firstName, lastName];
  
                  if ([firstName isEqualToString:@""] || [firstName isEqualToString:@"(null)"] || firstName == nil)
                  {
                      aName = [NSString stringWithFormat:@"%@", lastName];
                  }
  
                  if ([lastName isEqualToString:@""] || [lastName isEqualToString:@"(null)"] || lastName == nil)
                  {
                      aName = [NSString stringWithFormat:@"%@", firstName];
                  }
  
                  [self.tableItems addObject:aName];
              }
  
          }
  
          [self.tableItems sortUsingSelector:@selector(compare:)];
  </code></pre>