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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:47:01+00:00 2026-06-18T07:47:01+00:00

I am studying Object-C and I am writing a test app to learn. This

  • 0

I am studying Object-C and I am writing a test app to learn.
This is an easy app, where in the first View i press a button, go in the second View (I used a curl animation)fill a text field and then press a button, pass the content of the field in the first view.

So I created the 2 Views, placed a button and a Label in the first View and linked the button from the first View to the second View using the right mouse click and drag a line with action Modal.

In the second View, I wrote the following code:

ViewController2.h

@property (weak, nonatomic) IBOutlet UITextField *firstTextField;
@property (strong, nonatomic) NSString *stringFromVC2;

- (IBAction)passTextToVC2Button:(id)sender;

ViewController2.m

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.firstTextField.delegate = self;
}

- (IBAction)passTextToVC2Button:(id)sender {
    ViewController *VC2 = [self.storyboard instantiateViewControllerWithIdentifier:@"wb_ViewController"];

    VC2.stringFromTextField1 = self.firstTextField.text;

    [self presentViewController:VC2 animated:YES completion:nil];
}

The app works, but when I press the button from ViewController2, and go back to ViewController, it doesn’t animate the Curl animation, just it appears from the bottom of the page a new window (the ViewController) under the ViewController opened with the Curl animation.

I also tried to use:

[self dismissViewControllerAnimated:YES completion:nil];

instead of:

[self presentViewController:VC2 animated:YES completion:nil];

in this case, it closes the second view but the Label in the first View isn’t display with the text I inserted in the second View.

As I told you, I am studying so I am a beginner, please be patient.

  • 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-18T07:47:02+00:00Added an answer on June 18, 2026 at 7:47 am

    The way to do this is to define a delegate protocol that your first view controller conforms to, and your second view controller can send a message to to pass back the value.

    I’ve had to answer this question a few times so I created an very simple example project to show exactly what I mean. Download it and see how to pass data back down the controller stack.

    Update

    I’ve changed the sample to an new project for iOS6 with ARC and Storyboards.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

when studying RMI sometimes (head first Java) dudes use Naming.rebind(name, object) but other peoples
First of all, I am a beginner of object-c, I am studying it. I
I'm studying for an exam, and this is a problem from an old test:
Since I started studying object-oriented programming, I frequently read articles/blogs saying functions are better,
I'm studying the best data structures to implement a simple open-source object temporal database,
I've been studying some Object Oriented Analysis and Design lately, and I feel that
How many String object are created I am studying for the SCJP I cant
I'm studying C++ on my own time, and writing a linked list to try
I'm studying object literals and self-executing functions in Javascript. Looking through some YUI code
I'm new at object oriented programming and we are studying on a Java project.

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.