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

Re: NSUnarchiver unarchiveObjectWithData problem


  • Subject: Re: NSUnarchiver unarchiveObjectWithData problem
  • From: Marcel Weiher <email@hidden>
  • Date: Tue, 10 Jun 2003 13:18:36 +0200

Debugging Unarchiving can be very tricky.

Yup.

The only way I could really track down the object that was throwing exceptions was to remove each object or int, float, char* out of the encodeWithCoder and initWithCoder methods and run. If it ran without exception when the object was removed, then I found the issue.
I had similar problems like you stated, yet, I tracked down an encodeValueOfType( blah) problem with my issue.

If you find yourself getting bitten by this, you might try the encoding macros in MPWFoundation.

Encoding a variable then becomes:

encodeVar( coder, theVar );

Decoding is similar:

decodeVar( coder, theVar );

The macros take care of:

- getting the correct type of theVar
- getting the address of theVar
- sending the name of theVar (for coding with names, hasn't been adapted to Foundation keyed archiving yet)

I find them very convenient (otherwise I wouldn't have bothered). Along with the accessor macros, most of the "housekeeping" dealing with object state is taken care of conveniently enough that I haven't bothered the obvious further automation possibilities.

MPWFoundation can be found at my web site, and . Although you do have to contact me for licensing, licensing is generally free for both commercial and non-commercial use.

Marcel

--
Marcel Weiher Metaobject Software Technologies
email@hidden www.metaobject.com
Metaprogramming for the Graphic Arts. HOM, IDEAs, MetaAd etc.
f0249ab8b1af193ef5addcf39fdff5ca
_______________________________________________
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: 
 >Re: NSUnarchiver unarchiveObjectWithData problem (From: Craig Bakalian <email@hidden>)

  • Prev by Date: Re: Even more DO problems
  • Next by Date: Embedded frameworks and shared support helpers
  • Previous by thread: Re: NSUnarchiver unarchiveObjectWithData problem
  • Next by thread: How can I load a NSMovie from a NSFilewrapper?
  • Index(es):
    • Date
    • Thread