Ive had a look at many other questions regarding this (I know there are alot!), but none seem to satisfy my query.
Basically I have a view controller which includes two UITextFields.
The app is designed so that this page loads, the user inputs numbers, and then taps the background to get rid of the keyboard, and the values save. I then want this to be pre loaded in the text field every time the user navigates back to the page. I presume I will have to create another IBAction called saveData or something, but is there anyway to automatically save it when the background is tapped? Also to save the data I was thinking of using NSUserDefaults, are there any other methods to save data?
Any help is appreciated,
Michael
I use the following code for the editing and background tap part of my application:
-(IBAction) textFieldDoneEditing : (id) sender{
[sender resignFirstResponder];
}
-(IBAction) backgroundTap:(id) sender{
[self.textInputOne resignFirstResponder];
[self.textInputTwo resignFirstResponder];
}
NSUserDefaults will work nicely for this:
then in
- (void)viewDidLoadcall back the stored NSUserDefaults:Should work fine