Sets the contents of attributed string to the contents of the specified file.
- iOS 9.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The URL of the file to read.
The option keys for importing the document. For a list of possible values, see “Option keys for importing documents” in
On return, contains the document attributes. For a list of possible values, see “Document Attributes” in
Upon return, if an error occurs, contains an
NSErrorobject that describes the problem. If you are not interested in possible errors, pass in
YES if the attributed string is created successfully or
NO if it was not.
Filter services can be used to convert the contents of the URL into a format recognized by Cocoa.
For RTF formatted files, the contents of the file are appended to the previous string instead of replacing the previous string. Therefore, when using this method with existing content it's best to clear the content away explicitly.