• 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: Losing data with new archiving method?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Losing data with new archiving method?


  • Subject: RE: Losing data with new archiving method?
  • From: "Jonathan E. Jackel" <email@hidden>
  • Date: Mon, 10 Jun 2002 15:56:12 -0400

Cocoa does the versioning work for you. Use +setVersion: (NSObject) to set
the version number of your custom class. The version is archived along with
your objects. Your decoder would then use +version: in an if or switch
structure to properly handle "legacy" data files.

Jonathan

> -----Original Message-----
> From: email@hidden
> [mailto:email@hidden]On Behalf Of Donald Brown
> Sent: Monday, June 10, 2002 2:26 PM
> To: Thilo Ettelt; Cocoa dev
> Subject: Re: Losing data with new archiving method?
>
>
> Somehow, your code has to realize that it's reading an old file, and thus
> not read the objects in question. Or, you could write a
> converter app that
> reads the old, and writes the new, stuffing default data for the missing
> objects.
>
> What I've been doing is wrapping all my data up into an object
> (one of whose
> members is the array with data items). The first thing
> encoded/decoded is a
> 16 bit integer with the version number of the file, and the rest
> of the code
> checks the version number to decide how much to read.
>
> Donald
>
> on 6/10/02 1:14 PM, Thilo Ettelt at email@hidden wrote:
>
> > Hi! I've run into a little trouble. I'm archiving an NSMutableArray with
> > Classes that own a couple of objects. Now I have added a few objects to
> > these classes. So more objects are being encoded and decoded.
> > Unfortunately I'm not able to get the data from former archived data
> > anymore without getting an Exception? Or is there a method to get it?
> >
> > Thanks in advance!
> >
> >
> > Cheers, Thilo
> > _______________________________________________
> > 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.
>
> --
> Donald Brown
> email@hidden
> http://www.eamontales.com
>
> We have met the enemy and he is us - Pogo
> _______________________________________________
> 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.
_______________________________________________
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: Losing data with new archiving method?
      • From: Thilo Ettelt <email@hidden>
References: 
 >Re: Losing data with new archiving method? (From: Donald Brown <email@hidden>)

  • Prev by Date: Cocoa forums website
  • Next by Date: Re: Losing data with new archiving method?
  • Previous by thread: Re: Losing data with new archiving method?
  • Next by thread: Re: Losing data with new archiving method?
  • Index(es):
    • Date
    • Thread