• 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 - Solution
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Archiving ABPerson - Solution


  • Subject: Re: Archiving ABPerson - Solution
  • From: "Dr. H. Nikolaus Schaller" <email@hidden>
  • Date: Sat, 8 May 2004 16:05:01 +0200

So,
here is a solution using a non-documented private initializer:

@interface ABPerson (archiving) <NSCoding>
- (id) initWithUniqueId:(id) uniqueId; // private interface
@end

@implementation ABPerson (archiving)

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

- (id) initWithCoder:(NSCoder *)decoder;
{
/******** WORKAROUND ********/
self=[self initWithUniqueId:[decoder decodeObject]];
/******** WORKAROUND ********/
self=[self initWithVCardRepresentation:[decoder decodeDataObject]];
return self;
}

@end

So, my opinion is that initWithVCardRepresentation: should be renamed to setFromVCardRepresentation:

-- hns

Am 08.05.2004 um 14:52 schrieb Dr. H. Nikolaus Schaller:

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
_______________________________________________
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.


  • Follow-Ups:
    • Re: Archiving ABPerson - Solution
      • From: Scott Ahten <email@hidden>
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: Archiving ABPerson
  • Next by Date: Re: [semi-OT] Apple's Help Viewer: a note to the frustrated
  • Previous by thread: Re: Archiving ABPerson
  • Next by thread: Re: Archiving ABPerson - Solution
  • Index(es):
    • Date
    • Thread