saving a bunch of data using user.default. everything saves fine except one dictionary [Int:String]. The funny part is this, I can save a dictionary [String:Int] fine, but a
The Object that you are trying to save in the UserDefualt must be of type NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary. As per apple docs:
A default object must be a property list—that is, an instance of (or for collections, a combination of instances of) NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary. If you want to store any other type of object, you should typically archive it to create an instance of NSData. UserDefault Documentation
The key of NSDictionary is a string or a type conforming to NSCopying protocol.
You can try this:
let yourData = NSKeyedArchiver.archivedDataWithRootObject(yourDictionary)
let userDefualts = UserDefaults.standard
userDefualts.set(yourData, forKey: "yourKey")