Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
- Subject: Re: Why Don't Cocoa's (Un)Archiving Methods return Errors?
- From: Jerry Krinock <email@hidden>
- Date: Sat, 30 Jul 2011 22:21:07 -0700
On 2011 Jul 30, at 21:09, Jens Alfke wrote:
> On Jul 29, 2011, at 8:22 PM, Jerry Krinock wrote:
>
>> +[NSKeyedArchiver isEncodeable:(id)object]
>> +[NSKeyedUnarchiver isAValidArchive:(NSData*)data]
BTW, I forgot to mention those methods should return BOOLs.
> Neither of these are feasible without actually running the archiving, including calling all of the arbitrary -initWithCoder: and -encodeWithCoder: methods. So they’d have all the same issues we’ve been discussing so far — they’d have to use a try…catch block around the [un]archiving, basically.
I don't think so, Jens. "They" is Apple. Apple has the source code for -initWithCoder: and -encodeWithCoder:. They could remove the lines of code where those exceptions are created and return NO instead.
Anyhow, Apple is smarter than me, and they've clearly got the resources to handle this as well as fix the more important bugs in Lion that I'm holding my breath waiting for them to fix :))
So I filed an Enhancement - Apple Bug ID# 9870474 asking for those two methods.
_______________________________________________
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