Creates a user defaults object initialized with the defaults for the specified database name.
- iOS 7.0+
- macOS 10.9+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The domain identifier of the search list.
If you pass
nilto this parameter, the system uses the default search list that the
standardclass method uses. Because a suite manages the defaults of a specified app group, a suite name must be distinct from your app’s main bundle identifier. The
globalis also an invalid suite name, because it isn't writeable by apps.
You can use this method when developing an app suite, to share preferences or other data among the apps, or when developing an app extension, to share preferences or other data between the extension and its containing app.
The argument and registration domains are shared between all instances of
suite parameter matches the domain parameter of the corresponding CFPreferences APIs (except when translating between Foundation and Core Foundation constants). Listing 1 shows two equivalent statements. For more details, see Preferences Utilities.
On macOS, specifying another app’s bundle identifier will get you that app’s preferences search list, unless prevented by the App Sandbox.