Re: How to run a panel that customizes a new NSDocument
Re: How to run a panel that customizes a new NSDocument
- Subject: Re: How to run a panel that customizes a new NSDocument
- From: Ben Haller <email@hidden>
- Date: Wed, 21 Oct 2009 22:26:13 -0400
On 21-Oct-09, at 10:13 PM, Adam R. Maxwell wrote:
No. If you return nil and the caller passed in an NSError
reference, you need to return a valid NSError or at least set
*outError = nil. That should fix the crash you showed.
In addition, your code must check the return value of [self
makeUntitledDocumentOfType:error:] like this:
...
Search for NSUserCancelledError on this page:
http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Documents/Articles/ErrorHandling.html
Ah, great. That explains that. Thanks!
Any tips on the other half of my question -- of how to correctly
create the document in the first place, i.e. how to get the user-
chosen data in to the document object without duplicating code that
belongs in NSDocumentController?
Ben Haller
Stick Software
_______________________________________________
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