• 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: How to run a panel that customizes a new NSDocument
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to run a panel that customizes a new NSDocument (From: Ben Haller <email@hidden>)
 >Re: How to run a panel that customizes a new NSDocument (From: Graham Cox <email@hidden>)
 >Re: How to run a panel that customizes a new NSDocument (From: Ben Haller <email@hidden>)
 >Re: How to run a panel that customizes a new NSDocument (From: Quincey Morris <email@hidden>)
 >Re: How to run a panel that customizes a new NSDocument (From: Ben Haller <email@hidden>)
 >Re: How to run a panel that customizes a new NSDocument (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: Re: How to run a panel that customizes a new NSDocument
  • Next by Date: Re: Cocoa-dev Digest, Vol 6, Issue 1522
  • Previous by thread: Re: How to run a panel that customizes a new NSDocument
  • Next by thread: Re: How to run a panel that customizes a new NSDocument
  • Index(es):
    • Date
    • Thread