Top "Nsuserdefaults" questions

NSUserDefaults is the Objective-C API for storing and retrieving user preferences in Apple's Foundation framework for Cocoa and Cocoa Touch.

Save custom objects into NSUserDefaults

I'm having a news ViewController and a TeamViewController. The TeamViewController contain a tableView of teamObjects which when selected is added …

ios swift nsuserdefaults
Save dictionary in userdefaults in swift 3 with xcode 8

I am using the following code to save an object to UserDefaults (previously NSUserDefaults) using xcode 8: let defaults = UserDefaults.standard() …

nsuserdefaults swift3 xcode8 ios10
How to save NSMutablearray in NSUserDefaults

I have two NSMutableArray's. They consist of images or text. The arrays are displayed via a UITableView. When I kill …

ios objective-c uitableview nsmutablearray nsuserdefaults
Why NSUserDefaults failed to save NSMutableDictionary in iOS?

I'd like to save an NSMutableDictionary object in NSUserDefaults. The key type in NSMutableDictionary is NSString, the value type is …

ios objective-c cocoa-touch nsuserdefaults nscoding
Check if UserDefault exists - Swift

I'm trying to check if the a user default exists, seen below: func userAlreadyExist() -> Bool { var userDefaults : NSUserDefaults = …

ios swift nsuserdefaults
Delete key values for NSUserDefaults in Swift

How to delete data from NSUserDefaults? There is quite a few answers how to do it in Objective C, but …

ios swift nsuserdefaults
Delete all keys from a NSUserDefaults dictionary iOS

I use the NSUserDefaults dictionary to store basic information such as high scores etc so that when the user closes …

ios objective-c swift cocoa-touch nsuserdefaults
iOS: Use a boolean in NSUserDefaults

When the rootViewController of my application is loaded, I want to be able to check whether or not the users …

iphone objective-c boolean nsuserdefaults modalviewcontroller
Saving custom Swift class with NSCoding to UserDefaults

I am currently trying to save a custom Swift class to NSUserDefaults. Here is the code from my Playground: import …

swift nsuserdefaults sigabrt nscoding
How to remove all UserDefaults data ? - Swift

I have this code to remove all UserDefaults data from the app: let domain = Bundle.main.bundleIdentifier! UserDefaults.standard.removePersistentDomain(…

ios swift nsuserdefaults