• 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: Unarchive consistency errors
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unarchive consistency errors


  • Subject: Re: Unarchive consistency errors
  • From: Prachi Gauriar <email@hidden>
  • Date: Sun, 25 Apr 2004 12:24:21 -0500

On Apr 25, 2004, at 9:27 AM, Sam Thorne wrote:

Hello,

I can't work out what the inconsistency might be in unarchiving.
My object inherits from NSObject so doesn't need to call [super initWithCoder:], the objects are encoded and decoded in the same order, why is this raising an inconsistency in unarchiving exception?

<snip>

[coder encodeObject:codeView]; // NSMutableArray

This line looks a little suspicious... It's just odd that an array would have a name ending in view, that's all.

Have you tried using the debugger? Just set it to break on [NSException raise] (in the Breakpoints window of the Debugger). Try encoding/decoding and see where the inconsistency occurs.

Also, have you looked into using keyed archives? They're really similar to what you have, but you encode each object with a key, and the order of encoding/decoding isn't important. From Apple, "Keyed archives are the preferred archive type in Mac OS X version 10.2 and later."

<http://developer.apple.com/documentation/Cocoa/Conceptual/Archiving/ index.html?http://developer.apple.com/documentation/Cocoa/Conceptual/ Archiving/Concepts/archives.html>

-Prachi
_______________________________________________
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: Unarchive consistency errors
      • From: Sam Thorne <email@hidden>
References: 
 >Unarchive consistency errors (From: Sam Thorne <email@hidden>)

  • Prev by Date: Re: Resolving aliases in a path
  • Next by Date: Java_com_apple_cocoa_application_NSText_scrollRangeToVisible
  • Previous by thread: Unarchive consistency errors
  • Next by thread: Re: Unarchive consistency errors
  • Index(es):
    • Date
    • Thread