title: ABRecordCopyValue and ABPropertyID crash
body: <p>I'm trying to retrieve data from the iPhone address book and I have some problems.</p>
  
  <p>First of all, I have an array of all contacts (<code>self.allContacts</code>):</p>
  
  <pre><code>
  ABAddressBookRef abRef = ABAddressBookCreate();     
  self.allContacts = (NSMutableArray*)ABAddressBookCopyArrayOfAllPeople(abRef);
  </code></pre>
  
  <p>I also have an array of all properties (each property as string) called <code>self.allKeys</code>.</p>
  
  <p>The crash occurs when I try to get the properties using a property from <code>self.allKeys</code>:</p>
  
  <pre><code>
  NSString *currentRecord = [[NSString alloc] init];
  ABRecordRef currentRecordRef;
  ABPropertyID currentFieldProperty;
  
  currentRecordRef =  (ABRecordRef)[self.allContacts objectAtIndex:i];
  currentFieldProperty = (ABPropertyID)[self.allKeys objectAtIndex:j];
  
  currentRecord = (NSString*)ABRecordCopyValue(currentRecordRef, currentFieldProperty);                                   
  </code></pre>
  
  <p>The problem is that passing <code>currentFieldProperty</code> to <code>ABRecordCopyValue</code> causes a crash.</p>
  
  <hr>
  
  <ul>
  <li><code>self.allContacts</code> is an array of all contacts</li>
  <li><code>self.allKeys</code> is an array of all properties (each property as string)</li>
  </ul>
  
  <p>When trying to retrieve a single property from <code>ABRecordCopyValue</code> it causes an <code>EXC_BAD_ACCESS</code> crash.</p>
  
  <p>Thanks!</p>