Hi,
I am able to read the contacts in iPhone simulator contacts using following code.But when i add new contact in iPhone simulator from objective C then this code not give new contact which i add.. Please tell me the whats problem
Thank you..
code:
-
ABAddressBookRef ab;
ab = ABAddressBookCreate();
int len = (int) ABAddressBookGetPersonCount(ab);
int i;
for(i = 1; i < (len + 1); i++)
{
AABRecordRef person = ABAddressBookGetPersonWithRecordID(ab,(ABRecordID) i);
CFStringRef firstName, lastName;
char *lastNameString, *firstNameString;
firstName = ABRecordCopyValue(person, kABPersonFirstNameProperty);
}
I am able to read the contacts in iPhone simulator contacts using following code.But when i add new contact in iPhone simulator from objective C then this code not give new contact which i add.. Please tell me the whats problem
Thank you..
code:
-
ABAddressBookRef ab;
ab = ABAddressBookCreate();
int len = (int) ABAddressBookGetPersonCount(ab);
int i;
for(i = 1; i < (len + 1); i++)
{
AABRecordRef person = ABAddressBookGetPersonWithRecordID(ab,(ABRecordID) i);
CFStringRef firstName, lastName;
char *lastNameString, *firstNameString;
firstName = ABRecordCopyValue(person, kABPersonFirstNameProperty);
}