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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:21:10+00:00 2026-05-18T20:21:10+00:00

Hey all, Here’s a funny one. I have two ViewControllers: first one (fires on

  • 0

Hey all,
Here’s a funny one. I have two ViewControllers:
first one (fires on app load) – > displays a textField and a button.
When button is pressed, the text in the textField is to be passed on to the second ViewController through the action method of the button. the second ViewController is to display the text in a Label.
The string remains null 🙁
The label does not change 🙁

Other thing i did – inside the action method of the first ViewController – I created a new UILabel (you can’t see it here…), set its text field to the input i received from the user, then i set the second ViewController’s Label to be that one. The label still did not change, but at least the text field of the new label did change. If anyone could explain this to me as well, a=i’ll be happy to learn another new thing…

first controller code:

#import "FlipsideViewController.h"

@interface MainViewController : UIViewController <FlipsideViewControllerDelegate> {
    UITextField *theTextInput;
}

@property (nonatomic, retain) IBOutlet UITextField *theTextInput;
- (IBAction)textFieldDoneEditing:(id)sender;

- (IBAction)showInfo:(id)sender;

@end 

the .m relevant part (“FlipsideViewController” is the secondViewController i mentioned):

- (IBAction)showInfo:(id)sender {    

    FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
    controller.delegate = self;
controller.textToTransmit.text = self.theTextInput.text;
controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:controller animated:YES];

    [controller release];
}

and this is the second ViewController:

#import <UIKit/UIKit.h>

@protocol FlipsideViewControllerDelegate;


@interface FlipsideViewController : UIViewController {
    UILabel *textToTransmit;
    id <FlipsideViewControllerDelegate> delegate;

}

@property (nonatomic, assign) id <FlipsideViewControllerDelegate> delegate;
@property (nonatomic, retain) IBOutlet UILabel *textToTransmit;
- (IBAction)done:(id)sender;
-(void)updateLabel:(NSString *)str;
@end


@protocol FlipsideViewControllerDelegate
- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller;
@end

and it’s .m file:

#import "FlipsideViewController.h"


@implementation FlipsideViewController
@synthesize textToTransmit;
@synthesize delegate;



- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor viewFlipsideBackgroundColor];      
}


- (IBAction)done:(id)sender {
    [self.delegate flipsideViewControllerDidFinish:self];   
}

....

Any of you who had the patience to read through my Q – I will be gratefull for an answer that will help me move forward.

regards,
Joe

  • 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-18T20:21:10+00:00Added an answer on May 18, 2026 at 8:21 pm

    reposition your line that sets the text, so that is after your presentModalViewController:

    FlipsideViewController *controller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil];
    controller.delegate = self;
    controller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:controller animated:YES];
    
    controller.textToTransmit.text = self.theTextInput.text;
    [controller release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all, Here's a funny one. I have two ViewControllers: first one (fires on
Hey all, got one mountain of a problem here. I have completed a program
Hey all. Here is the scenario. I have the below code, and I'm needing
Hey there. I've read all the related articles on here and can't find one
Hey all- I have looked this up on here and Google but none of
Hey all here are my tables i have placed in a DIV for each.
Hey all here is one question from Gate exam which i found a bit
Hey all, have a slight problem here. In CakePHP I have a controller that
hey all, I'm very confused here, i've been trying to figure this one out.
Hey all i have this code here on jsfiddle: http://jsfiddle.net/d7UjD/6/ I have 2 problems

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.