I have 3 UIVIewControllers that have NSUsuerDefaults to store data. My 4th UIViewController is used to display the total data collected between the first 3 UIViewControllers. How do I collect the data and display it in a UITextfield? Here is an example of my NSUserDefault code that I’m using:
[tex setText:[[NSUserDefaults standardUserDefaults] objectForKey:@”storedTextValue1″]];
[tex setText:[[NSUserDefaults standardUserDefaults] objectForKey:@”storedTextValue22″]];
[tex setText:[[NSUserDefaults standardUserDefaults] objectForKey:@”storedTextValue43″]]; I want to add this collected data to a UITextfield on my 4th UIViewController.
I have 3 UIVIewControllers that have NSUsuerDefaults to store data. My 4th UIViewController is
Share
I think you should use
So basically you need to use
valueForKey:in place ofobjectForKey:Hope this helps you.
EDIT:
EDIT-2:
UITextField(Total) is Say
txtTotalUITextField(storetext1) is say
txtStore1UITextField(storetext2) is say
txtStore2UITextField(storetext3) is say
txtStore3Now simply do this as