Sets the value of the specified default key to the specified URL.
SDKs
- iOS 4.0+
- macOS 10.6+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
Parameters
urlThe URL to store in the defaults database.
defaultNameThe key with which to associate the value.
Discussion
If url is a file URL, this method takes the absolute, determines whether its path can be made relative to the user’s home directory, and if so, abbreviates it using the abbreviating method.
If url isn’t a file URL, a data object is created by calling the archived method and passing url as the root object.