Writes a property list representation of the contents of the dictionary to a given path.
- iOS 2.0–11.0Deprecated
- macOS 10.0–10.13Deprecated
- Mac Catalyst 13.0–13.0Deprecated
- tvOS 9.0–11.0Deprecated
- watchOS 2.0–4.0Deprecated
The path at which to write the file.
pathcontains a tilde (~) character, you must expand it with
expandingbefore invoking this method.
Tilde In Path
A flag that specifies whether the file should be written atomically.
true, the dictionary is written to an auxiliary file, and then the auxiliary file is renamed to
false, the dictionary is written directly to
trueoption guarantees that
path, if it exists at all, won’t be corrupted even if the system should crash during writing.
true if the file is written successfully, otherwise
This method recursively validates that all the contained objects are property list objects (instances of
NSDictionary) before writing out the file, and returns
false if all the objects are not property list objects, since the resultant file would not be a valid property list.
If the dictionary’s contents are all property list objects, the file written by this method can be used to initialize a new dictionary with the class method
dictionary or the instance method
If you need greater control over the property list representation, use
For more information about property lists, see Property List Programming Guide.