Re: NSDocument initWithContentsOfURL vs readFromURL
Re: NSDocument initWithContentsOfURL vs readFromURL
- Subject: Re: NSDocument initWithContentsOfURL vs readFromURL
- From: Mike Abdullah <email@hidden>
- Date: Mon, 20 May 2013 14:44:16 +0100
On 20 May 2013, at 11:29, Trygve Inda <email@hidden> wrote:
> When I open a document from a file (double clicking or via File-Open), my
> Document object gets
>
> -(id)initWithContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName
> error:(NSError **)outError
>
> It seems like I could just read the file there and load it into my internal
> structures in my Document instance.
>
> Why then is there the method below (and when would it be called)?
>
> -(BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName
> error:(NSError **)outError
-readFromURL:… is used both for creating documents, and when reverting a document. The latter is especially important for Versions integration.
_______________________________________________
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