mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Added the iOS implementation of the FileSystem API.
This commit is contained in:
@@ -52,9 +52,9 @@ export class UserPreferences {
|
||||
if ("undefined" == typeof defaultValue) {
|
||||
defaultValue = [];
|
||||
}
|
||||
var hashSet = utils_module.tk.utils.Collections.stringArrayToStringSet(defaultValue);
|
||||
var hashSet = utils_module.Collections.stringArrayToStringSet(defaultValue);
|
||||
var res = this.sharedPreferences.getStringSet(key, hashSet);
|
||||
return utils_module.tk.utils.Collections.stringSetToStringArray(res);
|
||||
return utils_module.Collections.stringSetToStringArray(res);
|
||||
}
|
||||
|
||||
public setBoolean(key: string, value: boolean) {
|
||||
@@ -90,7 +90,7 @@ export class UserPreferences {
|
||||
|
||||
public setStrings(key: string, values: string[]) {
|
||||
var editor = this.sharedPreferences.edit();
|
||||
var hashSet = utils_module.tk.utils.Collections.stringArrayToStringSet(values);
|
||||
var hashSet = utils_module.Collections.stringArrayToStringSet(values);
|
||||
editor.putStringSet(key, hashSet);
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export class UserPreferences {
|
||||
public getStrings(key: string, defaultValue?: string[]): string[] {
|
||||
if (this.containsKey(key)) {
|
||||
var nsArray = this.userDefaults.stringArrayForKey(key);
|
||||
var jsArray = utils_module.tk.utils.Collections.nsArrayToJSArray(nsArray);
|
||||
var jsArray = utils_module.Collections.nsArrayToJSArray(nsArray);
|
||||
return jsArray;
|
||||
}
|
||||
if ("undefined" == typeof defaultValue) {
|
||||
@@ -101,7 +101,7 @@ export class UserPreferences {
|
||||
}
|
||||
|
||||
public setStrings(key: string, values: string[]) {
|
||||
var nsArray = utils_module.tk.utils.Collections.jsArrayToNSArray(values);
|
||||
var nsArray = utils_module.Collections.jsArrayToNSArray(values);
|
||||
this.userDefaults.setObjectForKey(nsArray, key);
|
||||
this.userDefaults.synchronize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user