nsuserdefaults

NSUserDefaults are not being written to disk

Hello, I set some values to NSUserDefaults and if I retrieve them without exiting the app, everything works fine. When I restart the app, the changes disappear in 95% of the time. In 5% of the time everything is being saved ok. I'm facing this problem for the first time. In my other apps I don't usually save NSString in NSUserDefaults....

is it possible to store single linked list information in NSUserDefaults of iphone

is it possible to store single linked list information in NSUserDefaults of iphone. If there is an another way to store the information please mention that also ...

How to save data in NSUserDefaults even if app will be deleted?

I save some strings and numbers to NSUSerDefault, but when I uninstall and reinstall the app the data is ereased. Is there a possibility to store data some where else? Maybe in keychain? ...

Can other programs read my NSUserDefaults settings?

On the iphone can other apps read the values you've set using NSUserDefaults? Not including jail-broken phones. I'm considering saving the customer's userid/password for our service. Thanks, ...

UserDefaults/KeyedArchiver Frustrations

I'm working on a homework app that uses custom Assignment objects for each assignment. I am trying to store an NSMutableArray (casted to an NSArray via initWithArray:) in standardUserDefaults but I'm having trouble with saving and reloading the array. I have a table view from which you can choose to add a new assignment (which loads N...

How to use another app's settings

What code could I use in an iPhone app to get and set the settings of another app I wrote? (preferably using NSUserDefaults) ...

How to update an NSUserDefault

I have the following code which should update a value in NSUserDefaults: - (id) createBoardWithTitle:(NSString *)pTitle withScores:(NSArray *)pScores andNames:(NSArray *)pNames andDisplayStrings:(NSArray *)pStrings orderBy:(NSString *)pOrder ofType:(NSString *)pType { if((self == [super init])) { boardEntries = [NSMutable...

How to save aUIImage using NSUserDefaults

How do I save an Image to User Defaults ...

How do I save and read an image to my temp folder when quitting and loading my app

I want to save and read a UIImage to my temp folder when my app closes and then load and delete it when the app loads. How do I accomplish this. Please help. ...

NSUserDefaults - How to tell if a key exists

Alright, so I'm working on a small iPhone app, and I am using NSUserDefaults as my data persistence. It only has to keep track of a few things, such as some names and some numbers so I figure I might as well keep it simple. I found this page for some reference, but I don't think it can answer my question. Basically, I want to be able ...

iphone dev - NSUserDefaults check for boolean existance

Hi... I've just added a settings bundle to my app and am having trouble reading the bool settings. I know that upon launch of the app, the settings are not read unless the user actually enters them - and that's what I am trying to capture. However, my code is simply capturing if the answer is NO OR they havent been set. I need to find ...

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 = [NSDate date]; [[NSUserDefaults sharedUserDefaults] setObject:myDate forKey:@"myDateKey"]; // Get NSDate *myDate = (NSDate *)[[NSUserDefaults sharedUserDefaults] objectForKey:@"myDateKey"]; Option 2 - t...

How do I tell if NSUserDefaults is already sved

I want to have an If statement that allows me to tell whether I have an NSUserDefaults saved or not. ...

How to pull a string out from NSUserDefaults

Alright, I have my code, and I believe I have narrowed down the crashing bug to one section. Upon the view loading, my code loads the NSUserDefaults and pulls the string out of them. It then works with teh string. The problem is, I'm not sure how to pull the string out. Here is the relative code: NSUserDefaults *prefs = [NSUserDefau...

How to register user defaults using NSUserDefaults without overwriting existing values?

I have an AppDelegate class with +(void)initialize method that I use to register some defaults. Here's the code that I use: + (void)initialize { NSDictionary *defaults = [NSDictionary dictionaryWithObjectsAndKeys:@"NO", @"fooKey", @"YES", @"barKey", nil]; [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; } I also...

NSUserDefaults saved data making it to the app store.

Hey If I have some saving in NSUserDefaults whilst debugging my app, and then I submit it to the store, will the stuff be stored on that too? or does it get cleared when saved for a new distribution? Cheers Sam ...

iPhone, Where do I have to save user generated files if I want them to stay there after an app Upgrade (new release)? is Documents directory good?

I have an app that lets user record their own audio. By now I'm saving those files into Documents directory. My question is: if I will release a new version of that app, will user recorded files get deleted? Is there a better place to store user generated audio files? Should I use NSUserDefaults for data that stay even after app upgrad...

Is it possible to share a settings bundle and NSUserDictionary object between applications?

My guess is that the answer is "no", but I figured I'd ask anyway. Lets say that I have a shared library that multiple applications build into their executables. Now lets say that this shared library provides an API to some web service that uses the same username/password for all n number of applications that use the library. Is it pos...

iphone Settings application persist data

In my app I'm using an NSUserDefaults object to store the username, password and server URL in the built-in Settings app. If there is no data saved, the user is presented a login interface and upon succesful login the username and password are saved. Then in my app I have a view which displays this information, but the text is missing as...

Accepted way to let user "reset" apps settings (NSUserDefaults)?

I'd like to allow users to reset the Defaults in the iPhone's Settings for my app. I don't seem to be able to find any examples in apps that I've seen. Basically you'd go to Settings and find the settings for your app. At the bottom of the list there'd be some kind of option to Reset or Defaults or whatever. I'm just not sure how to hand...