Writes the document data to disk at the sandbox location indicated by a file URL.
- iOS 5.0+
If the object encapsulating the document data is of some other type, you should override this method or
writeto perform the actual writing of the data.
Contents: and Attributes: safely To URL: for Save Operation: error:
A file URL specifying the location of the document file in the application sandbox.
A constant that indicates whether the document file is being written the first time or whether it is being overwritten. See
A file URL specifying the previous location of the document file (if not
If you override this method and cannot write the document data for any reason, return by indirection an
NSErrorobject that encapsulates the reasons why you can’t. Otherwise, ignore this parameter.
YES if the write operation succeeds, otherwise
This method is called by the
write to write the actual file data. It is passed the contents object returned from your
contents implementation. The default implementation of this method supports
NSFile contents by asking the contents object to save itself to the corresponding URL.
If you override this method, you may choose to return a different type of data from
contents or you may choose to not override
contents and generate the writable data directly within this method. If you override this method, you should not invoke the superclass implementation.