• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Archiving ABPerson
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Archiving ABPerson


  • Subject: Re: Archiving ABPerson
  • From: Scott Ahten <email@hidden>
  • Date: Sat, 8 May 2004 10:02:15 -0400

Yes. I noticed that limitation as well. Putting aside the creation of a new UID, The following also works....

ABPerson * newPerson =[[[ABPerson alloc] init] initWithVCardRepresentation: vCardData];

Not sure if that causes any problems in regards to the Objective-C language, but it does assign a [new] unique ID.

I have tried calling [newPerson SetValue:"aUniqueID" forProperty:kABUIDProperty ] to assign a unique Id, but it seems to have no effect.

I was thinking about archiving a NSDictionary of vCard data with UID keys instead of an NSArray. This would transmit the missing UID and provide a "index" to ABPerson objects for comparison operations.

- Scott


On May 8, 2004, at 8:52 AM, Dr. H. Nikolaus Schaller wrote:

I have to add that the method described below assigns a new uniqueId on decoding, so that comparisons based on comparing the archived uniqueId with the original will fail.

Nikolaus

Am 08.05.2004 um 12:27 schrieb Dr. H. Nikolaus Schaller:

I just rean into the same issue.

To me it appears that it is not a bug in addRecord: but in initWithVCardRepresentation: as the message appears just when this method is called.

A workaround is:

@implementation ABPerson (archiving)

- (void) encodeWithCoder:(NSCoder *) coder;
{
[coder encodeDataObject:[self vCardRepresentation]];
}

- (id) initWithCoder:(NSCoder *)decoder;
{
self=[self init]; // this call assigns a uniqueId
self=[self initWithVCardRepresentation:[decoder decodeDataObject]];
return self;
}

@end
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.





- - - - -
:: email@hidden
:: http://www.pixelfreak.net
- - - - -
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Archiving ABPerson (From: Scott Ahten <email@hidden>)
 >Re: Archiving ABPerson (From: Vince DeMarco <email@hidden>)
 >Re: Archiving ABPerson (From: Scott Ahten <email@hidden>)
 >Re: Archiving ABPerson (From: Scott Ahten <email@hidden>)
 >Re: Archiving ABPerson (From: Vince DeMarco <email@hidden>)
 >Re: Archiving ABPerson (From: "Dr. H. Nikolaus Schaller" <email@hidden>)
 >Re: Archiving ABPerson (From: "Dr. H. Nikolaus Schaller" <email@hidden>)

  • Prev by Date: Re: Can a sheet appear at an arbitrary window position?
  • Next by Date: Re: Archiving ABPerson - Solution
  • Previous by thread: Re: Archiving ABPerson
  • Next by thread: Re: Archiving ABPerson - Solution
  • Index(es):
    • Date
    • Thread