initWithContentsOfURL:ofType:
Initializes and returns a document object of a given type.
Declaration
- (id) initWithContentsOfURL:(NSURL *) url ofType:(NSString *) typeName;Discussion
Initializes and returns an NSDocument object of document type docType containing data stored at aURL. In opening the location, invokes the readFromURL:ofType: method. If the document successfully opens the location, it updates fileURL and fileType. If the location cannot be opened, or the document is unable to load the contents of the location, this method returns nil. This initializer is typically invoked by the NSDocumentController method makeDocumentWithContentsOfURL:ofType:.
See Also
Methods
dataRepresentationOfType:fileAttributesToWriteToFile:ofType:saveOperation:fileNamefileWrapperRepresentationOfType:initWithContentsOfFile:ofType:loadDataRepresentation:ofType:loadFileWrapperRepresentation:ofType:printShowingPrintPanel:readFromFile:ofType:readFromURL:ofType:revertToSavedFromFile:ofType:revertToSavedFromURL:ofType:runModalPageLayoutWithPrintInfo:saveToFile:saveOperation:delegate:didSaveSelector:contextInfo:saveToURL:ofType:forSaveOperation:error: