Package apple.foundation
Class NSUserDefaults
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.foundation.NSUserDefaults
-
- All Implemented Interfaces:
NSObject
public class NSUserDefaults extends NSObject
NSUserDefaults is a hierarchical persistent interprocess (optionally distributed) key-value store, optimized for storing user settings. Hierarchical: NSUserDefaults has a list of places to look for data called the "search list". A search list is referred to by an arbitrary string called the "suite identifier" or "domain identifier". When queried, NSUserDefaults checks each entry of its search list until it finds one that contains the key in question, or has searched the whole list. The list is (note: "current host + current user" preferences are unimplemented on iOS, watchOS, and tvOS, and "any user" preferences are not generally useful for applications on those operating systems): - Managed ("forced") preferences, set by a configuration profile or via mcx from a network administrator - Commandline arguments - Preferences for the current domain, in the cloud - Preferences for the current domain, the current user, in the current host - Preferences for the current domain, the current user, in any host - Preferences added via -addSuiteNamed: - Preferences global to all apps for the current user, in the current host - Preferences global to all apps for the current user, in any host - Preferences for the current domain, for all users, in the current host - Preferences global to all apps for all users, in the current host - Preferences registered with -registerDefaults: Persistent: Preferences stored in NSUserDefaults persist across reboots and relaunches of apps unless otherwise specified. Interprocess: Preferences may be accessible to and modified from multiple processes simultaneously (for example between an application and an extension). Optionally distributed (Currently only supported in Shared iPad for Students mode): Data stored in user defaults can be made "ubiqitous", i.e. synchronized between devices via the cloud. Ubiquitous user defaults are automatically propagated to all devices logged into the same iCloud account. When reading defaults (via -*ForKey: methods on NSUserDefaults), ubiquitous defaults are searched before local defaults. All operations on ubiquitous defaults are asynchronous, so registered defaults may be returned in place of ubiquitous defaults if downloading from iCloud hasn't finished. Ubiquitous defaults are specified in the Defaults Configuration File for an application. Key-Value Store: NSUserDefaults stores Property List objects (NSString, NSData, NSNumber, NSDate, NSArray, and NSDictionary) identified by NSString keys, similar to an NSMutableDictionary. Optimized for storing user settings: NSUserDefaults is intended for relatively small amounts of data, queried very frequently, and modified occasionally. Using it in other ways may be slow or use more memory than solutions more suited to those uses. The 'App' CFPreferences functions in CoreFoundation act on the same search lists that NSUserDefaults does. NSUserDefaults can be observed using Key-Value Observing for any key stored in it. Using NSKeyValueObservingOptionPrior to observe changes from other processes or devices will behave as though NSKeyValueObservingOptionPrior was not specified.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Block_accessibilityActivateBlock_ret, NSObject.Block_accessibilityActivationPointBlock_ret, NSObject.Block_accessibilityAttributedHintBlock_ret, NSObject.Block_accessibilityAttributedLabelBlock_ret, NSObject.Block_accessibilityAttributedUserInputLabelsBlock_ret, NSObject.Block_accessibilityAttributedValueBlock_ret, NSObject.Block_accessibilityContainerTypeBlock_ret, NSObject.Block_accessibilityCustomActionsBlock_ret, NSObject.Block_accessibilityCustomRotorsBlock_ret, NSObject.Block_accessibilityDecrementBlock_ret, NSObject.Block_accessibilityElementsBlock_ret, NSObject.Block_accessibilityElementsHiddenBlock_ret, NSObject.Block_accessibilityFrameBlock_ret, NSObject.Block_accessibilityHeaderElementsBlock_ret, NSObject.Block_accessibilityHintBlock_ret, NSObject.Block_accessibilityIdentifierBlock_ret, NSObject.Block_accessibilityIncrementBlock_ret, NSObject.Block_accessibilityLabelBlock_ret, NSObject.Block_accessibilityLanguageBlock_ret, NSObject.Block_accessibilityMagicTapBlock_ret, NSObject.Block_accessibilityNavigationStyleBlock_ret, NSObject.Block_accessibilityPathBlock_ret, NSObject.Block_accessibilityPerformEscapeBlock_ret, NSObject.Block_accessibilityRespondsToUserInteractionBlock_ret, NSObject.Block_accessibilityShouldGroupAccessibilityChildrenBlock_ret, NSObject.Block_accessibilityTextualContextBlock_ret, NSObject.Block_accessibilityTraitsBlock_ret, NSObject.Block_accessibilityUserInputLabelsBlock_ret, NSObject.Block_accessibilityValueBlock_ret, NSObject.Block_accessibilityViewIsModalBlock_ret, NSObject.Block_automationElementsBlock_ret, NSObject.Block_isAccessibilityElementBlock_ret, NSObject.Block_setAccessibilityActivateBlock, NSObject.Block_setAccessibilityActivationPointBlock, NSObject.Block_setAccessibilityAttributedHintBlock, NSObject.Block_setAccessibilityAttributedLabelBlock, NSObject.Block_setAccessibilityAttributedUserInputLabelsBlock, NSObject.Block_setAccessibilityAttributedValueBlock, NSObject.Block_setAccessibilityContainerTypeBlock, NSObject.Block_setAccessibilityCustomActionsBlock, NSObject.Block_setAccessibilityCustomRotorsBlock, NSObject.Block_setAccessibilityDecrementBlock, NSObject.Block_setAccessibilityElementsBlock, NSObject.Block_setAccessibilityElementsHiddenBlock, NSObject.Block_setAccessibilityFrameBlock, NSObject.Block_setAccessibilityHeaderElementsBlock, NSObject.Block_setAccessibilityHintBlock, NSObject.Block_setAccessibilityIdentifierBlock, NSObject.Block_setAccessibilityIncrementBlock, NSObject.Block_setAccessibilityLabelBlock, NSObject.Block_setAccessibilityLanguageBlock, NSObject.Block_setAccessibilityMagicTapBlock, NSObject.Block_setAccessibilityNavigationStyleBlock, NSObject.Block_setAccessibilityPathBlock, NSObject.Block_setAccessibilityPerformEscapeBlock, NSObject.Block_setAccessibilityRespondsToUserInteractionBlock, NSObject.Block_setAccessibilityShouldGroupAccessibilityChildrenBlock, NSObject.Block_setAccessibilityTextualContextBlock, NSObject.Block_setAccessibilityTraitsBlock, NSObject.Block_setAccessibilityUserInputLabelsBlock, NSObject.Block_setAccessibilityValueBlock, NSObject.Block_setAccessibilityViewIsModalBlock, NSObject.Block_setAutomationElementsBlock, NSObject.Block_setIsAccessibilityElementBlock, NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNSUserDefaults(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()voidaddSuiteNamed(@NotNull java.lang.String suiteName)-addSuiteNamed: adds the full search list for 'suiteName' as a sub-search-list of the receiver's.static NSUserDefaultsalloc()static NSUserDefaultsallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)@Nullable NSArray<?>arrayForKey(@NotNull java.lang.String defaultName)-arrayForKey: is equivalent to -objectForKey:, except that it will return nil if the value is not an NSArray.static booleanautomaticallyNotifiesObserversForKey(@NotNull java.lang.String key)booleanboolForKey(@NotNull java.lang.String defaultName)-boolForKey: is equivalent to -objectForKey:, except that it converts the returned value to a BOOL.static voidcancelPreviousPerformRequestsWithTarget(@NotNull java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull java.lang.Object aTarget, @NotNull org.moe.natj.objc.SEL aSelector, @Nullable java.lang.Object anArgument)static @NotNull NSArray<java.lang.String>classFallbacksForKeyedArchiver()static @NotNull org.moe.natj.objc.ClassclassForKeyedUnarchiver()@Nullable NSDatadataForKey(@NotNull java.lang.String defaultName)-dataForKey: is equivalent to -objectForKey:, except that it will return nil if the value is not an NSData.static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()@Nullable NSDictionary<java.lang.String,?>dictionaryForKey(@NotNull java.lang.String defaultName)-dictionaryForKey: is equivalent to -objectForKey:, except that it will return nil if the value is not an NSDictionary.@NotNull NSDictionary<java.lang.String,?>dictionaryRepresentation()-dictionaryRepresentation returns a composite snapshot of the values in the receiver's search list, such that [[receiver dictionaryRepresentation] objectForKey:x] will return the same thing as [receiver objectForKey:x].doubledoubleForKey(@NotNull java.lang.String defaultName)-doubleForKey: is similar to -integerForKey:, except that it returns a double, and boolean values will not be converted.floatfloatForKey(@NotNull java.lang.String defaultName)-floatForKey: is similar to -integerForKey:, except that it returns a float, and boolean values will not be converted.static longhash_static()NSUserDefaultsinit()-init is equivalent to -initWithSuiteName:nilNSUserDefaultsinitWithSuiteName(@Nullable java.lang.String suitename)-initWithSuiteName: initializes an instance of NSUserDefaults that searches the shared preferences search list for the domain 'suitename'.NSUserDefaultsinitWithUser(@NotNull java.lang.String username)Deprecated.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)longintegerForKey(@NotNull java.lang.String defaultName)-integerForKey: is equivalent to -objectForKey:, except that it converts the returned value to an NSInteger.static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static @NotNull NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(@NotNull java.lang.String key)static NSUserDefaultsnew_objc()@Nullable java.lang.ObjectobjectForKey(@NotNull java.lang.String defaultName)-objectForKey: will search the receiver's search list for a default with the key 'defaultName' and return it.booleanobjectIsForcedForKey(@NotNull java.lang.String key)-objectIsForcedForKey: returns YES if the value for 'key' is provided by managed preferences (a configuration profile or mcx)booleanobjectIsForcedForKeyInDomain(@NotNull java.lang.String key, @NotNull java.lang.String domain)-objectIsForcedForKey:inDomain: returns YES if the value for 'key' is provided by managed preferences (a configuration profile or mcx) for the search list named by 'domain'@Nullable NSDictionary<java.lang.String,?>persistentDomainForName(@NotNull java.lang.String domainName)-persistentDomainForName: returns a dictionary representation of the search list entry specified by 'domainName', the current user, and any host.@NotNull NSArray<?>persistentDomainNames()Deprecated.voidregisterDefaults(@NotNull NSDictionary<java.lang.String,?> registrationDictionary)-registerDefaults: adds the registrationDictionary to the last item in every search list.voidremoveObjectForKey(@NotNull java.lang.String defaultName)-removeObjectForKey: is equivalent to -[...voidremovePersistentDomainForName(@NotNull java.lang.String domainName)-removePersistentDomainForName: removes all values from the search list entry specified by 'domainName', the current user, and any host.voidremoveSuiteNamed(@NotNull java.lang.String suiteName)-removeSuiteNamed: removes a sub-searchlist added via -addSuiteNamed:.voidremoveVolatileDomainForName(@NotNull java.lang.String domainName)static voidresetStandardUserDefaults()+resetStandardUserDefaults releases the standardUserDefaults and sets it to nil.static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)voidsetBoolForKey(boolean value, @NotNull java.lang.String defaultName)-setBool:forKey: is equivalent to -setObject:forKey: except that the value is converted from a BOOL to an NSNumber.voidsetDoubleForKey(double value, @NotNull java.lang.String defaultName)-setDouble:forKey: is equivalent to -setObject:forKey: except that the value is converted from a double to an NSNumber.voidsetFloatForKey(float value, @NotNull java.lang.String defaultName)-setFloat:forKey: is equivalent to -setObject:forKey: except that the value is converted from a float to an NSNumber.voidsetIntegerForKey(long value, @NotNull java.lang.String defaultName)-setInteger:forKey: is equivalent to -setObject:forKey: except that the value is converted from an NSInteger to an NSNumber.voidsetObjectForKey(@Nullable java.lang.Object value, @NotNull java.lang.String defaultName)-setObject:forKey: immediately stores a value (or removes the value if nil is passed as the value) for the provided key in the search list entry for the receiver's suite name in the current user and any host, then asynchronously stores the value persistently, where it is made available to other processes.voidsetPersistentDomainForName(@NotNull NSDictionary<java.lang.String,?> domain, @NotNull java.lang.String domainName)-setPersistentDomain:forName: replaces all values in the search list entry specified by 'domainName', the current user, and any host, with the values in 'domain'.voidsetURLForKey(@Nullable NSURL url, @NotNull java.lang.String defaultName)-setURL:forKey is equivalent to -setObject:forKey: except that the value is archived to an NSData.static voidsetVersion_static(long aVersion)voidsetVolatileDomainForName(@NotNull NSDictionary<java.lang.String,?> domain, @NotNull java.lang.String domainName)static @NotNull NSUserDefaultsstandardUserDefaults()+standardUserDefaults returns a global instance of NSUserDefaults configured to search the current application's search list.@Nullable NSArray<java.lang.String>stringArrayForKey(@NotNull java.lang.String defaultName)-stringForKey: is equivalent to -objectForKey:, except that it will return nil if the value is not an NSArray. @Nullable java.lang.StringstringForKey(@NotNull java.lang.String defaultName)-stringForKey: is equivalent to -objectForKey:, except that it will convert NSNumber values to their NSString representation.static org.moe.natj.objc.Classsuperclass_static()booleansynchronize()-synchronize is deprecated and will be marked with the API_DEPRECATED macro in a future release.@Nullable NSURLURLForKey(@NotNull java.lang.String defaultName)-URLForKey: is equivalent to -objectForKey: except that it converts the returned value to an NSURL.static booleanuseStoredAccessor()Deprecated.static longversion_static()@NotNull NSDictionary<java.lang.String,?>volatileDomainForName(@NotNull java.lang.String domainName)@NotNull NSArray<java.lang.String>volatileDomainNames()Volatile domains are not added to any search list, are not persisted, and are not visible to other applications.-
Methods inherited from class apple.NSObject
accessibilityActivate, accessibilityActivateBlock, accessibilityActivationPoint, accessibilityActivationPointBlock, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedHintBlock, accessibilityAttributedLabel, accessibilityAttributedLabelBlock, accessibilityAttributedUserInputLabels, accessibilityAttributedUserInputLabelsBlock, accessibilityAttributedValue, accessibilityAttributedValueBlock, accessibilityContainerType, accessibilityContainerTypeBlock, accessibilityCustomActions, accessibilityCustomActionsBlock, accessibilityCustomRotors, accessibilityCustomRotorsBlock, accessibilityDecrement, accessibilityDecrementBlock, accessibilityDirectTouchOptions, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsBlock, accessibilityElementsHidden, accessibilityElementsHiddenBlock, accessibilityFrame, accessibilityFrameBlock, accessibilityHeaderElementsBlock, accessibilityHint, accessibilityHintBlock, accessibilityIdentifierBlock, accessibilityIncrement, accessibilityIncrementBlock, accessibilityLabel, accessibilityLabelBlock, accessibilityLanguage, accessibilityLanguageBlock, accessibilityMagicTapBlock, accessibilityNavigationStyle, accessibilityNavigationStyleBlock, accessibilityPath, accessibilityPathBlock, accessibilityPerformEscape, accessibilityPerformEscapeBlock, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityRespondsToUserInteractionBlock, accessibilityScroll, accessibilityShouldGroupAccessibilityChildrenBlock, accessibilityTextualContext, accessibilityTextualContextBlock, accessibilityTraits, accessibilityTraitsBlock, accessibilityUserInputLabels, accessibilityUserInputLabelsBlock, accessibilityValue, accessibilityValueBlock, accessibilityViewIsModal, accessibilityViewIsModalBlock, accessibilityZoomInAtPoint, accessibilityZoomOutAtPoint, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, automationElements, automationElementsBlock, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hash, indexOfAccessibilityElement, isAccessibilityElement, isAccessibilityElementBlock, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivateBlock, setAccessibilityActivationPoint, setAccessibilityActivationPointBlock, setAccessibilityAttributedHint, setAccessibilityAttributedHintBlock, setAccessibilityAttributedLabel, setAccessibilityAttributedLabelBlock, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedUserInputLabelsBlock, setAccessibilityAttributedValue, setAccessibilityAttributedValueBlock, setAccessibilityContainerType, setAccessibilityContainerTypeBlock, setAccessibilityCustomActions, setAccessibilityCustomActionsBlock, setAccessibilityCustomRotors, setAccessibilityCustomRotorsBlock, setAccessibilityDecrementBlock, setAccessibilityDirectTouchOptions, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsBlock, setAccessibilityElementsHidden, setAccessibilityElementsHiddenBlock, setAccessibilityFrame, setAccessibilityFrameBlock, setAccessibilityHeaderElementsBlock, setAccessibilityHint, setAccessibilityHintBlock, setAccessibilityIdentifierBlock, setAccessibilityIncrementBlock, setAccessibilityLabel, setAccessibilityLabelBlock, setAccessibilityLanguage, setAccessibilityLanguageBlock, setAccessibilityMagicTapBlock, setAccessibilityNavigationStyle, setAccessibilityNavigationStyleBlock, setAccessibilityPath, setAccessibilityPathBlock, setAccessibilityPerformEscapeBlock, setAccessibilityRespondsToUserInteraction, setAccessibilityRespondsToUserInteractionBlock, setAccessibilityShouldGroupAccessibilityChildrenBlock, setAccessibilityTextualContext, setAccessibilityTextualContextBlock, setAccessibilityTraits, setAccessibilityTraitsBlock, setAccessibilityUserInputLabels, setAccessibilityUserInputLabelsBlock, setAccessibilityValue, setAccessibilityValueBlock, setAccessibilityViewIsModal, setAccessibilityViewIsModalBlock, setAutomationElements, setAutomationElementsBlock, setIsAccessibilityElement, setIsAccessibilityElementBlock, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, storedValueForKey, superclass, takeStoredValueForKey, takeValueForKey, takeValueForKeyPath, takeValuesFromDictionary, unableToSetNilForKey, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, valuesForKeys, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
alloc
public static NSUserDefaults alloc()
-
allocWithZone
public static NSUserDefaults allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(@NotNull @NotNull java.lang.String key)
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(@NotNull @NotNull java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(@NotNull @NotNull java.lang.Object aTarget, @NotNull @NotNull org.moe.natj.objc.SEL aSelector, @Nullable @Nullable java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
@NotNull public static @NotNull NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
@NotNull public static @NotNull org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
hash_static
public static long hash_static()
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
@NotNull public static @NotNull NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(@NotNull @NotNull java.lang.String key)
-
new_objc
public static NSUserDefaults new_objc()
-
resetStandardUserDefaults
public static void resetStandardUserDefaults()
+resetStandardUserDefaults releases the standardUserDefaults and sets it to nil. A new standardUserDefaults will be created the next time it's accessed. The only visible effect this has is that all KVO observers of the previous standardUserDefaults will no longer be observing it.
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
setVersion_static
public static void setVersion_static(long aVersion)
-
standardUserDefaults
@NotNull public static @NotNull NSUserDefaults standardUserDefaults()
+standardUserDefaults returns a global instance of NSUserDefaults configured to search the current application's search list.
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
URLForKey
@Nullable public @Nullable NSURL URLForKey(@NotNull @NotNull java.lang.String defaultName)
-URLForKey: is equivalent to -objectForKey: except that it converts the returned value to an NSURL. If the value is an NSString path, then it will construct a file URL to that path. If the value is an archived URL from -setURL:forKey: it will be unarchived. If the value is absent or can't be converted to an NSURL, nil will be returned. API-Since: 4.0
-
addSuiteNamed
public void addSuiteNamed(@NotNull @NotNull java.lang.String suiteName)-addSuiteNamed: adds the full search list for 'suiteName' as a sub-search-list of the receiver's. The additional search lists are searched after the current domain, but before global defaults. Passing NSGlobalDomain or the current application's bundle identifier is unsupported.
-
arrayForKey
@Nullable public @Nullable NSArray<?> arrayForKey(@NotNull @NotNull java.lang.String defaultName)
-arrayForKey: is equivalent to -objectForKey:, except that it will return nil if the value is not an NSArray.
-
boolForKey
public boolean boolForKey(@NotNull @NotNull java.lang.String defaultName)-boolForKey: is equivalent to -objectForKey:, except that it converts the returned value to a BOOL. If the value is an NSNumber, NO will be returned if the value is 0, YES otherwise. If the value is an NSString, values of "YES" or "1" will return YES, and values of "NO", "0", or any other string will return NO. If the value is absent or can't be converted to a BOOL, NO will be returned.
-
dataForKey
@Nullable public @Nullable NSData dataForKey(@NotNull @NotNull java.lang.String defaultName)
-dataForKey: is equivalent to -objectForKey:, except that it will return nil if the value is not an NSData.
-
dictionaryForKey
@Nullable public @Nullable NSDictionary<java.lang.String,?> dictionaryForKey(@NotNull @NotNull java.lang.String defaultName)
-dictionaryForKey: is equivalent to -objectForKey:, except that it will return nil if the value is not an NSDictionary.
-
dictionaryRepresentation
@NotNull public @NotNull NSDictionary<java.lang.String,?> dictionaryRepresentation()
-dictionaryRepresentation returns a composite snapshot of the values in the receiver's search list, such that [[receiver dictionaryRepresentation] objectForKey:x] will return the same thing as [receiver objectForKey:x].
-
doubleForKey
public double doubleForKey(@NotNull @NotNull java.lang.String defaultName)-doubleForKey: is similar to -integerForKey:, except that it returns a double, and boolean values will not be converted.
-
floatForKey
public float floatForKey(@NotNull @NotNull java.lang.String defaultName)-floatForKey: is similar to -integerForKey:, except that it returns a float, and boolean values will not be converted.
-
init
public NSUserDefaults init()
-init is equivalent to -initWithSuiteName:nil
-
initWithSuiteName
public NSUserDefaults initWithSuiteName(@Nullable @Nullable java.lang.String suitename)
-initWithSuiteName: initializes an instance of NSUserDefaults that searches the shared preferences search list for the domain 'suitename'. For example, using the identifier of an application group will cause the receiver to search the preferences for that group. Passing the current application's bundle identifier, NSGlobalDomain, or the corresponding CFPreferences constants is an error. Passing nil will search the default search list. API-Since: 7.0
-
initWithUser
@Deprecated public NSUserDefaults initWithUser(@NotNull @NotNull java.lang.String username)
Deprecated.-initWithUser: is equivalent to -init API-Since: 2.0 Deprecated-Since: 7.0 Deprecated-Message: Use -init instead
-
integerForKey
public long integerForKey(@NotNull @NotNull java.lang.String defaultName)-integerForKey: is equivalent to -objectForKey:, except that it converts the returned value to an NSInteger. If the value is an NSNumber, the result of -integerValue will be returned. If the value is an NSString, it will be converted to NSInteger if possible. If the value is a boolean, it will be converted to either 1 for YES or 0 for NO. If the value is absent or can't be converted to an integer, 0 will be returned.
-
objectForKey
@Nullable public @Nullable java.lang.Object objectForKey(@NotNull @NotNull java.lang.String defaultName)-objectForKey: will search the receiver's search list for a default with the key 'defaultName' and return it. If another process has changed defaults in the search list, NSUserDefaults will automatically update to the latest values. If the key in question has been marked as ubiquitous via a Defaults Configuration File, the latest value may not be immediately available, and the registered value will be returned instead.
-
objectIsForcedForKey
public boolean objectIsForcedForKey(@NotNull @NotNull java.lang.String key)-objectIsForcedForKey: returns YES if the value for 'key' is provided by managed preferences (a configuration profile or mcx)
-
objectIsForcedForKeyInDomain
public boolean objectIsForcedForKeyInDomain(@NotNull @NotNull java.lang.String key, @NotNull @NotNull java.lang.String domain)-objectIsForcedForKey:inDomain: returns YES if the value for 'key' is provided by managed preferences (a configuration profile or mcx) for the search list named by 'domain'
-
persistentDomainForName
@Nullable public @Nullable NSDictionary<java.lang.String,?> persistentDomainForName(@NotNull @NotNull java.lang.String domainName)
-persistentDomainForName: returns a dictionary representation of the search list entry specified by 'domainName', the current user, and any host.
-
persistentDomainNames
@NotNull @Deprecated public @NotNull NSArray<?> persistentDomainNames()
Deprecated.-persistentDomainNames returns an incomplete list of domains that have preferences stored in them. API-Since: 2.0 Deprecated-Since: 7.0 Deprecated-Message: Not recommended
-
registerDefaults
public void registerDefaults(@NotNull @NotNull NSDictionary<java.lang.String,?> registrationDictionary)-registerDefaults: adds the registrationDictionary to the last item in every search list. This means that after NSUserDefaults has looked for a value in every other valid location, it will look in registered defaults, making them useful as a "fallback" value. Registered defaults are never stored between runs of an application, and are visible only to the application that registers them. Default values from Defaults Configuration Files will automatically be registered.
-
removeObjectForKey
public void removeObjectForKey(@NotNull @NotNull java.lang.String defaultName)-removeObjectForKey: is equivalent to -[... setObject:nil forKey:defaultName]
-
removePersistentDomainForName
public void removePersistentDomainForName(@NotNull @NotNull java.lang.String domainName)-removePersistentDomainForName: removes all values from the search list entry specified by 'domainName', the current user, and any host. The change is persistent.
-
removeSuiteNamed
public void removeSuiteNamed(@NotNull @NotNull java.lang.String suiteName)-removeSuiteNamed: removes a sub-searchlist added via -addSuiteNamed:.
-
removeVolatileDomainForName
public void removeVolatileDomainForName(@NotNull @NotNull java.lang.String domainName)
-
setBoolForKey
public void setBoolForKey(boolean value, @NotNull @NotNull java.lang.String defaultName)-setBool:forKey: is equivalent to -setObject:forKey: except that the value is converted from a BOOL to an NSNumber.
-
setDoubleForKey
public void setDoubleForKey(double value, @NotNull @NotNull java.lang.String defaultName)-setDouble:forKey: is equivalent to -setObject:forKey: except that the value is converted from a double to an NSNumber.
-
setFloatForKey
public void setFloatForKey(float value, @NotNull @NotNull java.lang.String defaultName)-setFloat:forKey: is equivalent to -setObject:forKey: except that the value is converted from a float to an NSNumber.
-
setIntegerForKey
public void setIntegerForKey(long value, @NotNull @NotNull java.lang.String defaultName)-setInteger:forKey: is equivalent to -setObject:forKey: except that the value is converted from an NSInteger to an NSNumber.
-
setObjectForKey
public void setObjectForKey(@Nullable @Nullable java.lang.Object value, @NotNull @NotNull java.lang.String defaultName)-setObject:forKey: immediately stores a value (or removes the value if nil is passed as the value) for the provided key in the search list entry for the receiver's suite name in the current user and any host, then asynchronously stores the value persistently, where it is made available to other processes.
-
setPersistentDomainForName
public void setPersistentDomainForName(@NotNull @NotNull NSDictionary<java.lang.String,?> domain, @NotNull @NotNull java.lang.String domainName)-setPersistentDomain:forName: replaces all values in the search list entry specified by 'domainName', the current user, and any host, with the values in 'domain'. The change will be persisted.
-
setURLForKey
public void setURLForKey(@Nullable @Nullable NSURL url, @NotNull @NotNull java.lang.String defaultName)-setURL:forKey is equivalent to -setObject:forKey: except that the value is archived to an NSData. Use -URLForKey: to retrieve values set this way. API-Since: 4.0
-
setVolatileDomainForName
public void setVolatileDomainForName(@NotNull @NotNull NSDictionary<java.lang.String,?> domain, @NotNull @NotNull java.lang.String domainName)
-
stringArrayForKey
@Nullable public @Nullable NSArray<java.lang.String> stringArrayForKey(@NotNull @NotNull java.lang.String defaultName)
-stringForKey: is equivalent to -objectForKey:, except that it will return nil if the value is not an NSArray. Note that unlike -stringForKey:, NSNumbers are not converted to NSStrings.
-
stringForKey
@Nullable public @Nullable java.lang.String stringForKey(@NotNull @NotNull java.lang.String defaultName)-stringForKey: is equivalent to -objectForKey:, except that it will convert NSNumber values to their NSString representation. If a non-string non-number value is found, nil will be returned.
-
synchronize
public boolean synchronize()
-synchronize is deprecated and will be marked with the API_DEPRECATED macro in a future release. -synchronize blocks the calling thread until all in-progress set operations have completed. This is no longer necessary. Replacements for previous uses of -synchronize depend on what the intent of calling synchronize was. If you synchronized... - ...before reading in order to fetch updated values: remove the synchronize call - ...after writing in order to notify another program to read: the other program can use KVO to observe the default without needing to notify - ...before exiting in a non-app (command line tool, agent, or daemon) process: call CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication) - ...for any other reason: remove the synchronize call
-
volatileDomainForName
@NotNull public @NotNull NSDictionary<java.lang.String,?> volatileDomainForName(@NotNull @NotNull java.lang.String domainName)
-
volatileDomainNames
@NotNull public @NotNull NSArray<java.lang.String> volatileDomainNames()
Volatile domains are not added to any search list, are not persisted, and are not visible to other applications. Using them is not recommended.
-
useStoredAccessor
@Deprecated public static boolean useStoredAccessor()
Deprecated.
-
-