Re: vCard -> loss of Identity
Re: vCard -> loss of Identity
- Subject: Re: vCard -> loss of Identity
- From: Scott Ahten <email@hidden>
- Date: Thu, 2 Mar 2006 00:11:02 -0500
Steve,
I ran into a similar problem when trying to Archive address book
entries for transmission over a network.
The vCard spec does include a UID property, but it's optional.
ABPerson also has kABUIDProperty (inherited from ABRecord) but, for
some reason, it's not included when serialized using
vCardRepresentation. Since the spec indicates that the UID property
is a Global Unique Identifier, which should be a unique across all
vCard implementations, it's not clear why vCardRepresentation doesn't
include it. (perhaps the UIDs address book generates are only unique
for a particular user or somehow tied to the underlying database
implementation?)
I ended up making a keyed archive of the UID and vCard data for each
ABPerson object, then recreated the ABPerson record on the other side
using something like...
ABPerson * newPerson =[[[ABPerson alloc] initWithUniqueId:UIDString]
initWithVCardRepresentation: vCardData];
NOTE: [ABPerson initWithUniqueId] is a undocumented method. As such,
there's no guarantee if or how long it will remain available.
- Scott
On Feb 28, 2006, at 8:08 AM, Steve Cronin wrote:
Folks;
I've implemented an AddressBook ABPeoplePicker and that works fine.
I've also registered for drags from vCards and that is working fine.
From the user's point of view this is good: dragNdrop or a UI
widget, whatever you're in the mood for....
But here's the rub: I need to be able to tell that a given record
is the same as another.
In the ABPerson there is a property: kABUIDProperty
When I use [[ABPicker selectedRecords] objectAtIndex:i] to read
data I get consistent values for this property for a given record
in AddressBook. (I assume that this does not do a
'vCardRepresentation'!)
However when I read the kABUIDProperty value from the VERY SAME
record dropped as a vCard -> no joy (different values).
With a bit of fiddling I've managed to convince myself that any
wrapping in a vCard implies that you can never know that a given
vCard IS in fact the identical record as some other vCard.
I simply cannot be the first person to be bloodied by this. Is
there any collective wisdom or am I doomed to writing some
home-grown ABRecord coalescer?
As always THANK-YOU!
Steve
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40pixelfreak.net
This email sent to email@hidden
- - -
:: email@hidden
:: http://www.pixelfreak.net
- - -
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden