I am trying to save UserDefaults using methods from iOSKit.
I am pretty unclear on using declares but I think I am getting close to making this work.
With Foundation.NSUserDefaults() I want to create a dictionary to set the defaults. (Am I barking up the wrong tree?)
Here is my code.
[code]Dim PrefKey As Foundation.NSString = “Paid”
Dim PrefVal As Foundation.NSString = “True”
Dim PrefKeys As Foundation.NSArray //= Array(PrefKey, “test”) //Stuck here on how to populate array
Dim PrefVals As Foundation.NSArray //= Array(PrefVal, “test”)
Dim UserDefaults As Foundation.NSUserDefaults
Dim UserDefaultsDict As Foundation.NSDictionary
It’s not that complicated. Just declare a property of type NSUserDefaults. I have one in my App class called defaults because I find that convenient and I read somewhere that there is a small overhead/penalty if you repeatedly instantiate it.
Then, to write a boolean property (for example) just do this: