• 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: Why Don't Cocoa's (Un)Archiving Methods return Errors?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?


  • Subject: Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
  • From: email@hidden
  • Date: Fri, 29 Jul 2011 15:54:01 -0700

> The fact that these methods throw exceptions if their input data cannot be processed is very uncharacteristic of the Cocoa frameworks.

Now it is.  Back when NSCoding et al were written, possibly not.  Opinions on the use of exceptions vs other methods have waxed and waned over the years.  Only recently has there been a comparatively strong push towards NSError.

There are many APIs which are transitioning to NSError.  NSCoding and friends may also transition in time (or be replaced entirely...).

> When invoking -archivedDataWithRootObject: on, say, dictionary, finding an un-encodeable object buried somewhere in the dictionary would seem to be quite common.  Similarly, when invoking -unarchiveObjectWithFile:, no programmer can guarantee what may be found on the filesystem.

And this is one of several concerns with the NSCoding system.  It may be that the reason these classes haven't been updated is because there's consternation over the value of such an update.  Some people consider NSCoding intractably insecure and ergo unsuitable for use in pretty much anything.  Others take issue with it for varied other reasons.  I personally like it, but it's not flawless.

I wouldn't stress too much over it, in any case.  Sooner or later a change will occur.  'til then, follow the best practices to date.
_______________________________________________

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

  • Follow-Ups:
    • Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
      • From: Thomas Davie <email@hidden>
    • Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
      • From: Kyle Sluder <email@hidden>
References: 
 >Why Don't Cocoa's (Un)Archiving Methods return Errors? (From: Jerry Krinock <email@hidden>)
 >Re: Why Don't Cocoa's (Un)Archiving Methods return Errors? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: toolbars & toolbar items in lion
  • Next by Date: Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
  • Previous by thread: Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
  • Next by thread: Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
  • Index(es):
    • Date
    • Thread