Re: NSUnarchiver unarchiveObjectWithData problem
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.