In my application I have to get the record form the AddressBook and after changing some information I wants to save it. This logic in not working in Lion, though it is perfectly working fine in Snow Leopard.
Code Example:
ABPerson *aPerson = (ABPerson *) [records objectAtIndex:0];
[aPerson setValue:@"Rambo" forProperty:kABFirstNameProperty];
[[ABAddressBook sharedAddressBook ] addRecord: aPerson];
if([[ABAddressBook sharedAddressBook ]hasUnsavedChanges])
{
[[ABAddressBook sharedAddressBook] save];
}
If condition is returing NO, it means address book do not have any unsaved changes, but I have just added a contact.
Please any body tell me what I am doing wrong? or what I need to do different in Lion.
Thanks.