title: How to search iPhone address book for specific user name based on variable and not a string
body: <p>Apple provides the following sample code in their QuickContacts project for how to search the address book for a particular user.</p>
  
  <pre><code>-(void)showPersonViewController
  {
   // Fetch the address book 
   ABAddressBookRef addressBook = ABAddressBookCreate();
  
   // Search for the person named "Appleseed" in the address book
   CFArrayRef people = ABAddressBookCopyPeopleWithName(addressBook, CFSTR("Appleseed"));
  
   // Display "Appleseed" information if found in the address book 
   if ((people != nil) &amp;&amp; (CFArrayGetCount(people) &gt; 0))
   {
    ABRecordRef person = CFArrayGetValueAtIndex(people, 0);
    ABPersonViewController *picker = [[[ABPersonViewController alloc] init] autorelease];
    picker.personViewDelegate = self;
    picker.displayedPerson = person;
    // Allow users to edit the person’s information
    picker.allowsEditing = YES;
  
    [self.navigationController pushViewController:picker animated:YES];
   }
   else 
   {
    // Show an alert if "Appleseed" is not in Contacts
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" 
                message:@"Could not find Appleseed in the Contacts application" 
                  delegate:nil 
               cancelButtonTitle:@"Cancel" 
               otherButtonTitles:nil];
    [alert show];
    [alert release];
   }
   CFRelease(addressBook);
   CFRelease(people);
  }
  </code></pre>
  
  <p>The line that I'm having trouble with is:</p>
  
  <pre><code>// Search for the person named "Appleseed" in the address book
  CFArrayRef people = ABAddressBookCopyPeopleWithName(addressBook, CFSTR("Appleseed"));
  </code></pre>
  
  <p>This will search the address book for the person named "Appleseed", but I want to search the address book based on a user that is stored in a variable.  For example, I'm trying:</p>
  
  <pre><code>Customer *customer = [customerArray objectAtIndex:indexPath.row];
  cell.textLabel.text = customer.name;
  
  CFArrayRef people = ABAddressBookCopyPeopleWithName(addressBook, CFSTR(customer.name));
  </code></pre>
  
  <p>The "customer.name" isn't resolving to the value that is stored.  I used NSLog to output the value of customer.name and it holds the expected value.</p>
  
  <p>How can I resolve this variable to a string so it will search the address book properly?</p>
  
  <p>Thanks!</p>