Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSUserDefaultsMBS class.

NSUserDefaultsMBS.NSArgumentDomain as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacBase Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the constants to specify the domain.

The domain consisting of defaults parsed from the application's arguments. These are one or more pairs of the form -default value included in the command-line invocation of the application.

NSUserDefaultsMBS.NSGlobalDomain as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacBase Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the constants to specify the domain.

The domain consisting of defaults meant to be seen by all applications.

NSUserDefaultsMBS.NSRegistrationDomain as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacBase Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes All
One of the constants to specify the domain.

The domain consisting of a set of temporary defaults whose values can be set by the application to ensure that searches will always be successful.

NSUserDefaultsMBS.NSUserDefaultsDidChangeNotification as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacBase Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes All
The notification name for a did change notification.

Use with the NSNotification* objects.

Some examples using this method:

NSUserDefaultsMBS.resetStandardUserDefaults

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacBase Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Synchronizes any changes made to the shared user defaults object and releases it from memory.
Example
NSUserDefaultsMBS.resetStandardUserDefaults

A subsequent invocation of standardUserDefaults creates a new shared user defaults object with the standard search list.

NSUserDefaultsMBS.standardUserDefaults as NSUserDefaultsMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method Cocoa MBS MacBase Plugin 10.3 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the shared defaults object.
Example
dim u as NSUserDefaultsMBS = NSUserDefaultsMBS.standardUserDefaults

If the shared defaults object does not exist yet, it is created with a search list containing the names of the following domains, in this order:

NSArgumentDomain, consisting of defaults parsed from the application's arguments. A domain identified by the application's bundle identifier
NSGlobalDomain, consisting of defaults meant to be seen by all applications. Separate domains for each of the user's preferred languages
NSRegistrationDomain, a set of temporary defaults whose values can be set by the application to ensure that searches will always be successful

The defaults are initialized for the current user. Subsequent modifications to the standard search list remain in effect even when this method is invoked again—the search list is guaranteed to be standard only the first time this method is invoked. The shared instance is provided as a convenience—you can create custom instances using the Constructor.

Some examples using this method:

The items on this page are in the following plugins: MBS MacBase Plugin.


The biggest plugin in space...