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.

Attempt to insert non-property list object when trying to save a custom object in Swift 3

I have a simple object which conforms to the NSCoding protocol. import Foundation class JobCategory: NSObject, NSCoding { var id: Int …

ios swift swift3 nsuserdefaults nscoding
What's the optimum way of storing an NSDate in NSUserDefaults?

There's two ways of storing an NSDate in NSUserDefaults that I've come across. Option 1 - setObject:forKey: // Set NSDate *myDate = […

cocoa datetime nsdate nsuserdefaults nstimeinterval
How can I reset the NSUserDefaults data in the iPhone simulator?

I've added NSUserDefaults data retrieval to my app, which is pretty nice. But for testing I would like to reset …

iphone ios cocoa-touch uikit nsuserdefaults
Store [String] in NSUserDefaults

I want to save a Swift Style String Array into NSUserDefaults, but acutally the "if" statement in the code says …

ios swift string nsarray nsuserdefaults
Programmatically set rootViewcontroller for UINavigationcontroller in Storyboard in Appdelegate

I have a value in NSUserdefaults. I am using storyboard, it is embedded in UINavigationController. - (BOOL)application:(UIApplication *)application …

objective-c uinavigationcontroller storyboard nsuserdefaults appdelegate
Is there a way to get all values in NSUserDefaults?

I would like to print all values I saved via NSUserDefaults without supplying a specific Key. Something like printing all …

iphone ios objective-c ios6 nsuserdefaults
(Swift) Storing and retrieving Array to NSUserDefaults

I am trying to store an array to NSUserDefaults and retrieve the array when needed to populate a UITableView. Currently …

ios swift tableview nsuserdefaults
NSUserDefaults removeObjectForKey vs. setObject:nil

Are the following two lines equivalent? 1. [[NSUserDefaults standardUserDefaults] removeObjectForKey:@"example key"] 2. [[NSUserDefaults standardUserDefaults] setObject:nil forKey:@"example key"]

nsuserdefaults
How to save an array of objects to NSUserDefault with swift?

this is a class Place I defined: class Place: NSObject { var latitude: Double var longitude: Double init(lat: Double, lng: …

ios swift nsuserdefaults
argument for generic parameter could not be inferred

I'm trying to save an array with NSUserDefaults and then load the array, but I get the error "argument for …

swift nsuserdefaults loaddata