I have the following code:
NSInteger phoneCount = ABMultiValueGetCount(phones);
NSMutableArray *phoneKeys = [[[NSMutableArray alloc] init] autorelease];
NSMutableArray *phoneKeyValues = [[[NSMutableArray alloc] init] autorelease];
for(CFIndex i=0; i < phoneCount; i++) {
//NSString *label = [(NSString *)ABMultiValueCopyLabelAtIndex(phones, i) autorelease];
NSString *phone = [(NSString *)ABMultiValueCopyValueAtIndex(phones, i) autorelease];
NSString *phoneIndex = [[[NSNumber alloc] initWithInt:ABMultiValueGetIdentifierAtIndex (phones, i)] autorelease];
[phoneKeys addObject:phoneIndex]; // it breaks on this line
}
NSLog(@"Count: %@ %@", [phoneKeys count], [phoneKeyValues count]);
Any idea why I would get EXC_BAD_ACCESS when I try to do [phoneKeys addObject:phoneIndex]?
Thanks in advance