nsuserdefaults

Binding a text field to Shared User defaults controller doesn't use null value

I set the text field to bind with a values controller key, a keypath of spacesPerTab, and setting 4 as the placeholder values. But when executing it, the text field displays nothing. This works for checkboxes. ...

Get settings through a button action

I am looking for a way to access user settings (I assume, NSUserDefaults?) through a button action. Let me back up and explain. What I have right now are 2 TextFields a label and a button. The user will type in measurements in the 2 TextFields. When they hit the button the label displays the volume of the measured object in Gallons. That...

iPhone inputting NSUserDefaults into a UITextField

I am writing a program where I where the first time a user runs it - they will have to fill out about 10 different UITextFields. I am trying to save the fields so that on subsequent runs of the program that whatever they previously put will already be displayed in those UITextFields so the wont have to re-input it in - unless they want ...

iPhone code to create new NSUserDefaults objects?

I have NSUserDefaults storing a number of string variables for things like name, date of birth, address, etc. What I would like to know is how to write a code that will create a new object for each new user. For example, I have a spinning wheel that shows up immediately after the first time the user runs the app. What I want, is for t...

NSUserDefaults loses 3 rows each time it's called

Hello Everyone! Brand new programmer here, so off-topic help/constructive criticism welcome. I am saving a default state (such as "New York") in a UIPickerView which is in a FlipSideView. It certainly saves for the first and second time I check to make sure it's the same state (I am clicking "done" and then "info" repeatedly), but on ...

iPhone settings not honoured

My iPhone app has the following problem: Freshly installed, when I read out my "Play Sound" preference with the following code: defaults = [NSUserDefaults standardUserDefaults]; NSLog(@"Play Sounds? %d", [defaults boolForKey:@"play_sounds_preference"]); The setting always reads out as false, even though the default setting is set to t...

NSUserDefaults and default language used for I18N

I have searched around a lot for this and found some answers that sounded quite like what I wanted but never worked. I simply need to have my iPhone app load NIBs and Localizable.strings that I decide (through user selection) rather than the ones that are established through the global iPhone/iPad settings. General consensus seems to be...

NSUserDefaults doesn't save

Hi everybody! i'm trying to save some informations in an iphone/ipad app. The problem is that it works but if i close the app (with the home button on the simulator or closing with cmd+q) the informations become lost! this is my code (and, if you see, i used "syncronize") - (IBAction)choose1{ NSUserDefaults *defaults = [NSUserDefa...

Converting NSUserDefaults to Keychain?

So, NSUserDefaults is quite easy to use. But apparently, it is not too secure - there is no encryption. And of course the client wants the app prefs to be secure because it contains sensitive data. But the Keychain is secure, though hard to code (apparently). So is there a way to easily convert NSUserDefaults code to Keychain code? In o...

Adding different save data to one file

I'm stuck at one of the last parts of my iApp, can someone help me? I want to add different field entries of different .m files into one file without overwriting the file. (I also dont know how to make that save file btw). I have 2 .h files with : file1 : NSString *dataHML; NSString *dataHML2; file2 : NSString *dataHML3; ...

How to temporarily change all default user settings without destroying the original?

My app is based strongly on a lot of NSUserDefault keys and values. I want to implement a temporary defaults profile which the user can activate to get a special task done easily. For this, some of the user defaults must be changed temporarily so the app adjusts it's interface appropriately. I started to just manually change those NSU...

How to make a dump of the current NSUserDefaults standardUserDefaults state to disk and read back in?

I want to have some way of backing up the user defaults to a property list or XML, or some other appropriate file format that can be transfered over the net. How could I get a backup of these so that I can send them to a webserver and retrieve them back to the device and read them in to the user defaults database? ...

Verifying existence of name and password in NSUserDefaults to Skip a login/Screen

I have a Tabbar/Tableview App that modally loads a Login/Signup view when the app loads, I have set up a Root.plist in a settings bundle for the name and password and have successfully retrieved the items. I want to be able to do two things: 1) Do a test to see if the NSUserDefault Strings are empty and if so load the Login/Signup view....

InAppSettingsKit without saving to Settings app

I've seen there is a library called InAppSettingsKit - http://www.inappsettingskit.com/ - which lets your in-app settings mimic your settings within the Settings app. But is there a way to get this to NOT use the Settings app as well? So it just allows you to change settings within the app. Or is there another library which does this...

Will there be any conflict with other applications when my application saves data in [NSUserDefaults standardUserDefaults]?

After reading this thread: http://stackoverflow.com/questions/2792932/nsuserdefaults-not-present-on-first-run-on-simulator I know it's quite easy to store some app data in the [NSUserDefaults standardUserDefaults]. But if other applications also happen to use the same key to store their data, is this possible that my app data gets overw...

Password test in 1st Tab.m to load a loginView gives class error?

I have a name and password in NSUserDefaults for login. I have this in my 1stTab View.m class to test for presence and load a login/signup loginView.xib modally if there is no password or name stored in the app. Here is the pulling of the defaults: -(void)refreshFields { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaul...

How to save Application State using NSUserDefaults in iPhone?

Hello Everyone, Following is what i am doing: - (void) applicationWillTerminate: (UIApplication*) application { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:navigationController.viewControllers forKey:@"diabetesstate"]; } - (void) applicationDidFinishLaunching: (UIApplication*) ...

NSUserDefaults - reload needed?

hey guys, I use NSUserDefaults to store some stuff. It works fine but only after i restart the app. I use: [prefs synchronize]; I thought it would immediately save the data but instead preferences stay null. If you have any idea or already deal with it let me know. Thanks for any help. Wallou ...

Best way to save to nsuserdefaults for custom class?

If I have a custom class Person which has three variables (which are propertized and synthesized): NSString* theName; float* theHeight; int theAge; Person instances are stored in an NSArray 'Group'. There is only one Group. What is the best way of storing and loading the Group in NSUserDefaults? (bearing in mind that float and int are...

Decide which caching startegy to use ?

Hi all, I want to cache my loaded data so that I can reduce my application start time . I know several strategies to store application data i.e. core data, nsuserdefaults , archiving . Now my scenario is that suppose that I have array of maximum 10 objects each object having 5 fields . So I can not decide which strategy to store th...