Changes to -makeDocumentWithContentsOfURL:ofType:error: in the last couple of OS releases?
Changes to -makeDocumentWithContentsOfURL:ofType:error: in the last couple of OS releases?
- Subject: Changes to -makeDocumentWithContentsOfURL:ofType:error: in the last couple of OS releases?
- From: Rick Mann <email@hidden>
- Date: Thu, 01 Nov 2012 00:53:11 -0700
I have some old code that would try to open a file using -openDocumentWithContentsOfURL:display:error:, if it existed and if it does not exist, would call -makeDocumentWithContentsOfURL:ofType:error: on that same URL, in an effort to create the missing document.
The code clearly expected to receive a valid document object from the call, but instead it's returning nil and setting the error: Error Domain=NSCocoaErrorDomain Code=260 "The file couldn’t be opened because it doesn’t exist."
Now, maybe this code never worked properly; it's a project I haven't touched in a long time. But has the behavior of this method changed in the last couple of OS releases? I have one of these default documents on disk; I just can't remember if I created with this code or some other means.
What's the difference between -openDocument… and -makeDocument…?
Thanks,
--
Rick
_______________________________________________
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