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

NSUnarchiver question


  • Subject: NSUnarchiver question
  • From: Alex Rice <email@hidden>
  • Date: Tue, 2 Oct 2001 01:21:10 -0600

[sorry if this is a duplicate post- my mail.app hung while sending]

Is there a way to "rollback" a NSCoder? I'm growing a very ad-hoc document format created with NSDocuments writing with NSArchiver archivedDataWithRootObject:.

What I'd like to do is something like this code fragment below. Is this possible? I can't see anything in NSCoder or NSUnarchiver to support this. There must be some design pattern I'm unaware of for doing this type of thing with serialized objects.

-initWithCoder: coder
{
// in a class deep within the object graph &
// in a galaxy far far away
// document features added after document version 1.0
NS_DURING
// v1.1 feature:
[coder decodeValueOfObjCType:@encode(typeof(feature)) at:&(feature)];
NS_HANDLER
feature = MyDefault;
NSLog(@"failed to read feature");
[coder rollback]; //?
NS_ENDHANDLER
// now the next object in the graph can be safely initWithCoder'd
}

TIA again

Alex Rice <email@hidden>
Mindlube Software
http://www.mindlube.com/


  • Follow-Ups:
    • Re: NSUnarchiver question
      • From: Raphael Sebbe <email@hidden>
  • Prev by Date: Re: nsdocument/nsapp delegate question
  • Next by Date: Re: NSUnarchiver question
  • Previous by thread: White Cursor
  • Next by thread: Re: NSUnarchiver question
  • Index(es):
    • Date
    • Thread