public class NSUserDefaults extends NSObject
Constructor and Description |
---|
NSUserDefaults(String suitename) |
Modifier and Type | Method and Description |
---|---|
boolean |
boolForKey(String key)
Returns a Boolean of the specified key either the default or false.
|
NSData |
dataForKey(String key)
Returns the data object of the specified key.
|
double |
doubleForKey(String key)
Returns the double number of the specified key.
|
float |
floatForKey(String key)
Returns the float number of the specified key.
|
int |
integerForKey(String key)
Returns the integer of the specified key.
|
Object |
objectForKey(String key)
Returns the object of the specified key.
|
void |
removeObjectForKey(String key)
Removes the specified key from the dictionary.
|
void |
setBool(boolean value,
String key)
Set the specified Boolean for the specified key.
|
void |
setDouble(double value,
String key)
Sets the specified double number for the specified key.
|
void |
setFloat(float value,
String key)
Sets the specified float number for the specified key.
|
void |
setInteger(int value,
String key)
Sets the specified integer number for the specified key.
|
void |
setObject(Object value,
String key)
Sets the specified object for the specified key.
|
static NSUserDefaults |
standardUserDefaults()
Returns the shared NSUserDefaults object.
|
String |
stringForKey(String key)
Returns the string of the specified key.
|
boolean |
synchronize()
Stores any changes to the disk and updates functionality of the
application according to the stored values.
|
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
public NSUserDefaults(String suitename)
public static NSUserDefaults standardUserDefaults()
public boolean synchronize()
public void setObject(Object value, String key)
value
- The object of the specified key.key
- The key for which the object is set.public Object objectForKey(String key)
key
- The key for which the object is requested.public void removeObjectForKey(String key)
key
- The key that is removed.public void setInteger(int value, String key)
value
- The integer number of the specified key.key
- The key for which the value is set.public int integerForKey(String key)
key
- The key for which the integer is returned.public void setFloat(float value, String key)
value
- The float number of the specified key.key
- The key for which the value is set.public float floatForKey(String key)
key
- The key for which float number is requested.public void setDouble(double value, String key)
value
- The double number of the specified key.key
- The key for which the value is set.public double doubleForKey(String key)
key
- The key for which double number is requested.public String stringForKey(String key)
key
- The key for which the string is requested.public void setBool(boolean value, String key)
value
- The Boolean for the specified key.key
- The key for which the Boolean value is set.public boolean boolForKey(String key)
key
- The key for which the Boolean is returned.Copyright © 2020. All rights reserved.