Re: Replace -[NSKeyedUnarchiver unarchiveObjectWithData:] so it doesn't crash on corrupt archive
Re: Replace -[NSKeyedUnarchiver unarchiveObjectWithData:] so it doesn't crash on corrupt archive
- Subject: Re: Replace -[NSKeyedUnarchiver unarchiveObjectWithData:] so it doesn't crash on corrupt archive
- From: Jerry Krinock <email@hidden>
- Date: Thu, 2 Jul 2009 23:26:02 -0700
On 2009 Jul 02, at 22:53, Jim Correia wrote:
Do you have a sample app & data combo which demonstrates the crash?
Yes, if you take the TEST CODE at the bottom of my original post and
revert to Apple's method by commenting out the +[NSKeyedUnarchiver
load] method in there, it will crash.
If you have no exception handler in place, the program will
terminate. But that isn't due to a bug in NSKeyedUnarchiver - it is
just working as advertised - whether or not you like the advertised
behavior.
Indeed, if I enclose it in a @try block, then it will not crash. But
I think it's error-prone and inconvenient to have to enclose it in a
@try block.
Is that what you mean by "exception handler in place"? -- enclose it
in a @try block ?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden