Re: Failure on unarchiving a NSBezierPath
Re: Failure on unarchiving a NSBezierPath
- Subject: Re: Failure on unarchiving a NSBezierPath
- From: "Kyle Sluder" <email@hidden>
- Date: Fri, 25 Apr 2008 04:29:17 -0400
On Fri, Apr 25, 2008 at 4:11 AM, an0 <email@hidden> wrote:
> Thanks. But it seems you haven't read to the end. As I said in my first mail:
>
> > Besides, I found the value returned by [NSKeyedUnarchiver
> > unarchiveObjectWithData:data] was nil, but I didn't understand why,
> > since it was normal when I saved the file using [NSKeyedArchiver
> > archivedDataWithRootObject:view.drawing].
But you apparently haven't comprehended Jens' message. You're not
setting *outError to anything, so whoever is calling your method is
seeing that you've returned NO and is expecting whatever it passed in
as outError to point to an NSError object. Unfortunately this is not
the case and whatever was in that memory location is receiving bogus
messages -- particularly, -localizedFailureReason, which is an NSError
method.
In short, you're breaking the contract for messages which take an
NSError**. Set *outError to an NSError object (or nil if you're lazy)
if you're going to return a value that signifies an error.
--Kyle Sluder
_______________________________________________
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