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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to