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 9318995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:16:23+00:00 2026-06-19T03:16:23+00:00

I have two classes, Step1 and Step2. Step1 contains a textfield called wrp. When

  • 0

I have two classes, Step1 and Step2. Step1 contains a textfield called wrp. When the user enters a number in wrp in Step1, I would like to be able to work with it in Step2. Here is what I have tried (this is code in Step2):

int AdditionalDays;

Step1ViewController *wrp1 = [Step1ViewController new];
UITextField *wrp = [wrp1 wrp];
AdditionalDays = [wrp.text intValue];

TotalTotal.text = [[NSString alloc] initWithFormat:@"%i", AdditionalDays];

The app does not throw an error message, but the user-entered number in wrp in Step1 is disregarded in Step2. I don’t know why it is not working. Any suggestions?

  • 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-06-19T03:16:24+00:00Added an answer on June 19, 2026 at 3:16 am

    In the line Step1ViewController *wrp1 = [Step1ViewController new]; you are creating a new instance of Step1ViewController. What you need to to is get a reference to the original Step1ViewController the user entered the text in.

    To do this, you would probably create a property in your Step2ViewController where you can pass in either the Step1ViewController, or even better, the value the user entered.

    So in your Step2ViewController class header, add a property like this:

    @property (assign) int additionalDays;
    

    Then, when you create the Step2ViewController to display it on screen, you set this property to the value the user entered, like this:

    Step2ViewController *controller  = [Step2ViewController new];
    controller.additionalDays = [wrp.text intValue];
    // push the controller on a UINavigationController or something
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two spring projects. Both are currently portlets. I would like to take
I have a java package which contains two classes. Class A and Class B.
I have two classes (MVC view model) which inherits from one abstract base class.
I have two classes A and B generated by cxf-codegen-plugin from my WSDL. A
I have two classes Foo and Bar . The tables in the database look
I have two classes Foo and Bar that Bar extends Foo as below: class
I have two classes, Item and SoldItem . SoldItem inherits from Item adding some
I have two classes, one that inherits from the other. The base class is
I have two classes, TestA and TestB . TestA extends QObject . I have
I have two classes set up as follows: class Point { protected: double coords[3];

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.