• 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: Failure on unarchiving a NSBezierPath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Failure on unarchiving a NSBezierPath


  • Subject: Re: Failure on unarchiving a NSBezierPath
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 24 Apr 2008 12:20:19 -0700


On 23 Apr '08, at 8:42 AM, an0 wrote:

Nothing appeared when I opened a saved file, and log said:
2008-04-23 23:33:44.127 EasyDraw[631:10b] *** -[NSDocumentController
localizedFailureReason]: unrecognized selector sent to instance
0x11b210

Something sent -localizedFailureReason: to an instance of NSDocumentController, apparently thinking it was an NSError*.
Given this method:


- (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError
{
   return [NSKeyedArchiver archivedDataWithRootObject:view.drawing];
}

I suspect what happened is that NSKeyedArchiver returned nil for some reason, and the caller of that method then looked at *outError to find the reason for the error; but you didn't store anything in there, so it got whatever happened to be in that variable, which in this case may have been a pointer to the NSDocumentController.


So try adding a test for nil to your save method. It looks like that's where the problem is.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Failure on unarchiving a NSBezierPath
      • From: an0 <email@hidden>
References: 
 >Failure on unarchiving a NSBezierPath (From: an0 <email@hidden>)

  • Prev by Date: Re: Resource Fork - is this a good use/the right thing to do?
  • Next by Date: NSLog() replacement for debugger output
  • Previous by thread: Failure on unarchiving a NSBezierPath
  • Next by thread: Re: Failure on unarchiving a NSBezierPath
  • Index(es):
    • Date
    • Thread