nsuserdefaults

How to store NSMutableArray of user defined class objects to file system in iphone?

Can anyone please tell me how to write NSMutableArray of custom class objects to file? below is the code which i am using to write my array "medicationsArray" to file. medicationsArray contains the objects of below medicationData class @interface medicationData: NSObject { NSString *drName; NSString *date; NSString *descript...

Can NSUserDefaults be used for pausing the application during a phone call ?

Friends, currently I dont have iphone to test and using Simulator for testing purposes. I am Just curious to know whether an application continues to run even after a phone call.. here i have no option to test this from simulator. If it terminates then how can i pause things.. and continue after a phone call. Is NSUserDefaults can be us...

Updating parent table after child update in uinvaigationcontroller

So you have UINavigationController, with a parent table which has one cell --------------- | paul > | --------------- And you click on it and get a screen which has textfields that you enter --------------- | name: paul | --------------- | age: 23 | --------------- | hair: brown | --------------- | etc | ----------...

Can you see the values of NSUserDefaults anywhere in the xcode debugger?

Can you see the values of NSUserDefaults naywhere in the xcode debugger? Just wondering if this is possible? Thanks, Nick ...

About get satisfactory api

I am develping an application in objective c for iphone, I added Getsatisfactoy thing in my code, there if i want to add reply to my application , in their example [[[NSUserDefaults standardUserDefaults] objectForKey:@"SRC_ME_ACCOUNT"] objectForKey:@"id"] ,in this id always nil , anything i have to set for this , what will be id will tak...

Preferred place to store username

I am dealing with a single username and password in an App, I'm storing the password in the keychain for security but where best to store the username? In NSUserDefaults, CFPreferences or is there a way to retrieve it out of the keychain along with the password. Later on there might be two entries in the keychain so I think this might ...

NSuserdefaults not loading in a tab bar controller, works on uiview

I have a problem getting the NSUserDefaults to pull out on a tab/nav/tableview controller page, I've put the same code on a loginpage and the app will pull the objects for keys perfectly. I had this working when I had programmatically created the tabs and navs but now it's not working. The loginViewController is not in the tab stack, is ...

Save string to the NSUserDefaults?

How to save a string into the NSUserDefaults? ...

integerForKey: always returns zero

Hi, i'm trying to retrieve a value from my preference file which is an integer. The funny thing is that it always returns zero, although it does exist and the names for both integerForKey: and setIntegerForKey: are the same. Here's how I retrieve the value: [defaults integerForKey:@"BackUpSize"]; And here I set it: [defaults setIntege...

Loading User Defaults That Changed While App In Background On iPhone OS 4.0

I have several user defaults set in my app: Snap Shots ON/OFF Startup Tips ON/OFF Game Music ON/OFF iPod Music ON/OFF Sound Effects ON/OFF Reset All Dolls ON/OFF When my app enters the backgound (in OS 4.0), my saveDefaults: method gets called from the applicationWillResignActive:(UIApplication *) method. Then in the applicationWillEn...

Limit the number of times an iPhone app is used.

Hi. Is there a way to limit the number of times an application is used in an iPhone (to implement the lite version)? I know I could use the UserDefaults, but if the user deletes and re-install the app, the limit would disappear. I tought of using a webserver, but it is too much work for a simple problem. Anybody had the same issue (an...

Array in Monotouch NSUserDefaults

Does anyone know how to store an array in Monotouch NSUserDefaults? One possible method: NSUserDefaults.StandardUserDefaults["Array"] = new NSObject(); But how do I turn an array or list into an NSObject? ...

How persistent is [NSUserDefaults standardUserDefaults]?

Hi all, I'm using [NSUserDefaults standardUserDefaults] for storing application settings. My questions are: do those settings are removed on app deletion? are they kept after an application update (through the AppStore)? Because I'm using it to store a password and don't want my users to reset them at each update. Also, I'd like th...

UserDefaults not saving values iphone

Hi all, This' is a strange problem I'm facing. The following code which I used to save my values to nsuserdefaults was working fine.. saving and retrieving all the values but it's totally driving me nuts now. It's not saving any values and the retrieved values are seen invalid. I'm using encoding and decoding to save my custom object na...

Variables not getting allocated iphone sdk

Hi all, I'm facing this problem in which my allocated variabls aren't getting allocated even if their retaincount is increamenting after every alloc/retain. NSMutableArray *companyArray = [[NSMutableArray alloc]init]; doesn't allocate companyArray but increaments the retain count of companyArray. If I print the description of it, the...

How to receive NSUserDefaultsDidChangeNotification iphone

Hi all, After a lot of searching I was not able to find wheather you need to pass a dictionary object to: [NSUserDefaultsDidChangeNotification addObserver: forKeyPath: options: context:]; and what should be provided in options if I want to be notified for even a single change in the userDefaults. Also what is keypath? Thanx in adva...

How to reload view when application becomes active after suspended?

When the user changes NsuserDefaults in settings on the iPhone and activates my app after it being suspended, i want to reload the active view. How can i do this? ...

How do I save objects in NSMutableArray after application is terminated?

Hi, I would like to save objects that the user adds to a NSMutableArray that I will be able to see and use even if I quit the application. I tried to use NSUserDefaults but I'm doing something wrong. Thanks! ...

iPhone's NSUserdefaults is a database or plist

Hi, I am not able to get NSUserDefaults concepts properly. Is that a database of plist file ? ...

Array doesn't persist outside viewDidLoad

Hi all, I'm facing a strange problem with NSUsrDefaults. Whenever I'm fetching the data from NSUserDefaults, it's getting populated temporarily. I'm fetching it into viewDidLoad where it's fetched. -(void)viewDidLoad{ companies = [NSMutableArray array]; oldCompanies = [[NSUserDefaults standardUserDefaults] arrayForKey:@"companyData"];...