Instance Method

readFromFileURL:options:documentAttributes:error:

Sets the contents of the receiver from the file at the given URL.

Declaration

- (BOOL)readFromFileURL:(NSURL *)url options:(NSDictionary *)opts documentAttributes:(NSDictionary * _Nullable *)dict error:(NSError * _Nullable *)error;

Parameters

url

The location of the file providing text data.

opts

The option keys for importing the document. For a list of possible values, see “Option keys for importing documents” in NSAttributedString.

dict

On return, contains the document attributes. For a list of possible values, see “Document Attributes” in NSAttributedString.

error

Upon return, if an error occurs, contains an NSError object that describes the problem. If you are not interested in possible errors, pass in NULL.

Return Value

YES if the attributed string is created successfully or NO if it was not.

Discussion

For RTF formatted files, the contents of the file are appended to the previous string instead of replacing the previous string.

See Also

Deprecated

- readFromData:options:documentAttributes:

Sets the contents of the receiver from the stream at data.

Deprecated
- readFromURL:options:documentAttributes:

Sets the contents of receiver from the file at url.

Deprecated