If I'm using NSUserDefaults to store settings for my application, is there any way to make my app's settings "hidden" from being shown in the general Settings application on the iPhone? I know there are other tools out there such as mySettings, Keychain, etc, but I'm just wondering if there is a flag somewhere that says 'do not show my s...
I have looked for several hours for a good tutorial on how to store data for my command line program that I am writing in Objective-C. It seems like my options are NSUserDefaults, Plists, sqlite, or XML.
Now, I think at most I'd have 50kb of data to store, retrieve, and modify, so it seems like from what I read Plists would work just f...
Using NSUserDefaults to save/load a few small values... it's pretty straightforward.
But WHERE would I place my SAVE or LOAD code?
I want the defaults to LOAD only if/when a certain view is displayed.
I want the defaults to SAVE, only when that view is exited/unloaded/hidden.
(I created a simple app using the "view-based template" an...
I have 2 views. When I'm on the 1st view, I have a textfield. I enter some text in the textfield. I exit the app, launch some another application and then return to my application. I want to maintain state of the textfield and that view. Likewise, if I quit with the 2nd view active, when I return to the app I need to return the view to t...
Okay, I'm trying to write a high score function for my app.
My problem is that when no high score has been saved yet, my program crashes.
If I save it with:
[[NSUserDefaults standardUserDefaults] setObject:@"[given string]" forKey:@"firstName"];
first, it works fine. However, if I start up the program for the first time and try to ...
Hi all, I have an app where when the user taps on a cell I would like for a check mark to appear and be persisted. So far this is my code.
-(void)viewDidLoad {
[super viewDidLoad];
NSString *path = [[NSBundle mainBundle] pathForResource:@"AirportList" ofType:@"plist"];
NSMutableArray *airArray = [[NSMutableArray alloc] initWithContent...
Hi everyone! My app involves a user being able to drag specific items such as volume sliders and UIImage views. My goal is to be able to save the locations of the items so that the user can not have to drag the items again after re-launch. Unfortunately, I have seen errors along taking the 'saving CGRect rect = item.frame to NSuserDef...
Hello,
My app has some languages that the user can change whenever wants.
The problem is that always uses the current device language selected, so at least my localizable strings are working as expected, but no matter wich language I set, I'm getting alwats the default selected of the device.
Where I have to call this code?
[[NSUserD...
I have an iPhone app that stores some settings using NSUserDefault standardUserDefaults. When I add new features to the app I need to add new default settings and so I have to migrate/upgrade the NSUserDefaults. For now I just store the version number and check this when the app is launched but it has quickly become very messy as I have ...
Alright, so I've been doing some poking around, and I realize my problem, but I don't know how to fix it. I have made a custom class to hold some data. I make objects for this class, and I need to them to last between sessions. Before I was putting all my information in NSUserDefaults, but this isn't working.
-[NSUserDefaults setObje...
Hello,
What happens with the NSUserDefaults values and the SQLite database after updating the application in the appstore?
Are they deleted or reseted or happens nothing with them?
Alex
...
Hello everyone,
How would I check in a "if" statement if the NSUserDefault object is saved there or not? I'm not really sure how to call it.. So a pretty short question..
Thanks
...
Hi,
I'm having a problem with NSUserDefaults. I've followed the steps in the books as closely as I can for my app, but still get the same problem.
I am getting a
*** -[NSUserDefaults integerForKey:]: message sent to deallocated instance 0x3b375a0
error when I try and load in the settings. Here is the code that I have, it is in the...
I have an app where I need a BOOL value to persist across launches.
The value should be YES on the first launch and user-customizable thereafter.
But if it's the first launch, how do I set the default to YES before the program is run?
...
Hi!
I have a NSManagedObject subclass named Tour. I stored the reference to it using this code:
prefs = [NSUserDefaults standardUserDefaults];
NSURL *myURL = [[myTour objectID] URIRepresentation];
NSData *uriData = [NSKeyedArchiver archivedDataWithRootObject:myURL];
[prefs setObject:uriData forKey:@"tour"];
Now I want to retrie...
I'm having a bit of a strange issue that I can't quite figure out. I'm somewhat of a n00b to Interface Builder. What I am trying to do seems like it should be simple, but it's not working for some reason.
In interface builder I have a preferences window with a simple NSTextField. I have set the value binding to the Shared User Defaults ...
according to this image, i try to save data in NSUserDefaults but my App not have application setting in menu Setting on iPhone?
how can i make this?
thanks.
...
I am using the following code to save values from a settings view that takes values from a UITextField and stores them with NSUserDefaults. The code below even calls synchronize yet it is not saving the changes. What am I doing wrong here?
- (IBAction)save {
NSLog(@"save");
NSUserDefaults *defaults = [NSUserDefaults standardUse...
Compare the following:
using NSUserDefaults saving it with synchronize
using NSDictionary saving it with writeToFile in the app Documents folder
What are the differences? Personally, I prefer to mantain different NSDictionary organized by topic rather than use a single NSUserDefaults.
Am I thinking something wrong? Thanks
...
I successfully stored and retrieved a reference to an NSManagedObject using the example found in this site http://cocoawithlove.com/2008/08/safely-fetching-nsmanagedobject-by-uri.html
The problem is, the app crash whene triying to retrieve an NSManagedObject which has been deleted.
I tried the method isFault on the object, but it alway...