tags:

views:

24

answers:

1

Hi group members, I want fetch all phone numbers from address book and i want to store in one array. For that am writing this code,but am getting this error at second line Program received signal: “EXC_BAD_ACCESS”

ABRecordRef person;
ABMultiValueRef phoneNumberProperty = ABRecordCopyValue(person, kABPersonPhoneProperty);
NSArray* phoneNumbers = (NSArray*)ABMultiValueCopyArrayOfAllValues(phoneNumberProperty);

// CFRelease(phoneNUmberProperty);

NSLog(@"Phone numbers = %@", phoneNumbers);
[phoneNumbers release];   

please help me what are changes can i do. Thanks in advance

A: 

ABRecordCopyValue will not get you all the phone numbers of a address book. You can use this to look up a property of 1 person. Use ABAddressBookCopyArrayOfAllPeople to get all the persons from the address book first.

Diederik Hoogenboom