• 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: Replace -[NSKeyedUnarchiver unarchiveObjectWithData:] so it doesn't crash on corrupt archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Replace -[NSKeyedUnarchiver unarchiveObjectWithData:] so it doesn't crash on corrupt archive (From: Jerry Krinock <email@hidden>)
 >Re: Replace -[NSKeyedUnarchiver unarchiveObjectWithData:] so it doesn't crash on corrupt archive (From: Jim Correia <email@hidden>)

  • Prev by Date: Re: documenting bindings (was: Re: Dynamically loading a part of a Window in Cocoa)
  • Next by Date: Re: User interface validation doesn't work, right?
  • Previous by thread: Re: Replace -[NSKeyedUnarchiver unarchiveObjectWithData:] so it doesn't crash on corrupt archive
  • Next by thread: Movable Document Modal Dialogs
  • Index(es):
    • Date
    • Thread