Instance Method

revert(toContentsOf:ofType:)

Overridden to clean up the managed object context and controllers during a revert.

Declaration

func revert(toContentsOf inAbsoluteURL: URL, ofType inTypeName: String) throws

Parameters

inAbsoluteURL

An URL object that specifies the location of the file to which to revert.

inTypeName

The type of the document at inAbsoluteURL.

outError

If the method fails to complete correctly, upon return contains an NSError object that describes the problem.

Return Value

true if the method completes correctly, otherwise false.

Discussion

See Also

Document Content Management

func read(from: URL, ofType: String)

Sets the contents of the receiver by reading from a file of a given type located by a given URL.

func write(to: URL, ofType: String, for: NSDocument.SaveOperationType, originalContentsURL: URL?)

Saves changes in the document’s managed object context and saves the document’s persistent store to a given URL.