I'm using below coding to get first name in string format but want to get this in an array as it includes both address book contacts and facebook contact. So that I can retrieve them like array[0],array[1] and soon.So plz help me to get this done.
ABAddressBookRef ab=ABAddressBookCreate();
NSArray *arrTemp=(NSArray *)ABAddressBookCopyArrayOfAllPeople(ab);
NSMutableArray *arrContact=[[NSMutableArray alloc] init];
for (int i=0;i<[arrTemp count];i++)
{
NSMutableDictionary *dicContact=[[NSMutableDictionary alloc] init];
NSString *str=(NSString *) ABRecordCopyValue([arrTemp objectAtIndex:i], kABPersonFirstNameProperty);
@try
{
[dicContact setObject:str forKey:@"name"];
}
@catch (NSException * e) {
[dicContact release];
continue;
}
[dicContact release];
NSLog(@"%@",str );