Re: ABPerson initWithVCardRepresentation without addRecord
Re: ABPerson initWithVCardRepresentation without addRecord
- Subject: Re: ABPerson initWithVCardRepresentation without addRecord
- From: Aaron Tuller <email@hidden>
- Date: Fri, 1 Jan 2010 14:07:23 -0800
At 2:49 PM +0100 12/31/09, B.Ohr wrote:
ps = ABPerson.alloc.initWithVCardRepresentation(data) #
MacRuby syntax ;-)
the generated person is added automatically to the AdressBook
database, in opposite to:
ps = ABPerson.alloc.init # not added
ABAddressBook.sharedAddressBook.addRecord(ps) # now it is added
My question is: How can I call initWithVCardRepresentation without
adding the person to the database?
Bernd
P.S.: I'm not sure, but I think that this is a new behavior in
10.6, I cannot remember this issue in
10.5..._______________________________________________
Yes we ran into this issue as well, it's pretty nasty. Here is my
workaround (works on 10.3-10.6):
ABPerson *p = [[ABPerson alloc] initWithVCardRepresentation:vcard];
ABAddressBook *ab = [ABAddressBook sharedAddressBook];
NSString *recordID = [p uniqueId];
if (recordID && [ab recordForUniqueId:recordID])
{
[ab removeRecord:p];
}
// do stuff with p
[p release];
Hope this helps.
-aaron
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden