I have a NSUserDefault
dictionary. One of the keys has a value of type [Int]
. I'm looking to figure out how to append Ints
to that embedded array.
var dictionary = ["keyOne" : [1,2,3,4,5]]
defaults.setObject(dictionary, forKey: "defaultDictionary")
What I'm currently doing is saving the dictionary to a variable, creating a variable array from the new dictionary variable and then appending that. Then I'm updating the dictionary with the new array and saving that dictionary back to the defaults.
Does anyone out there know of a direct way to append to the array without having to do all the middle work?