Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6365643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:19:07+00:00 2026-05-25T00:19:07+00:00

I have 3 UIVIewControllers that have NSUsuerDefaults to store data. My 4th UIViewController is

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:19:08+00:00Added an answer on May 25, 2026 at 12:19 am

    I think you should use

    tex setText:[[NSUserDefaults standardUserDefaults] valueForKey:@"storedTextValue43"];
    

    So basically you need to use valueForKey: in place of objectForKey:

    Hope this helps you.

    EDIT:

    [text setText:[NSString stringWithFormat:@"%@ %@ %@",[[NSUserDefaults standardUserDefaults] valueForKey:@"storedTextValue43"],[[NSUserDefaults standardUserDefaults] valueForKey:@"storedTextValue1"],[[NSUserDefaults standardUserDefaults] valueForKey:@"storedTextValue22"]]];
    

    EDIT-2:

    UITextField(Total) is Say txtTotal

    UITextField(storetext1) is say txtStore1

    UITextField(storetext2) is say txtStore2

    UITextField(storetext3) is say txtStore3

    Now simply do this as

    int sum = [txtStore1.text intValue] + [txtStore2.text intValue] + [txtStore3.text intValue]
    txtTotal.text = [NSString stringWithFormat:@%d",sum];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIViewController that manages the display of some data. When the user
I have a problem with data in UITableView. I have UIViewController, that contains UITableView
I have various UIViewControllers that need data from web services. Is it best to
First a little background info: I have UIViewController that contains a UITableView. In the
Assume that I have an application using tabbarcontroller with 10 UIViewControllers, once the UIViewController
I have a UIViewController that contains a subview and a UIToolbar. I'm trying to
I have a UIViewController subclass that I am trying to have handle the shake
Totally confused here. I have a PARENT UIViewController that needs to pass an NSMutableArray
I have 1 UIViewController. in that i wrote, - (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { NSLog(@A); }
I have a UIPopOverController that shows a UIViewController with a UITableview in its view.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.