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

  • Home
  • SEARCH
  • 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 9210697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:08:12+00:00 2026-06-18T01:08:12+00:00

I am trying to take the text that is typed into UITextFields in one

  • 0

I am trying to take the text that is typed into UITextFields in one view, and pass those values into a different View Controller when a button is pressed. In the first view controller (CreateViewController) I have:

#import <UIKit/UIKit.h>
#import <MessageUI/MFMailComposeViewController.h>
@class ThePreviewViewController;
@interface CreateViewController : UIViewController <UIAlertViewDelegate, MFMailComposeViewControllerDelegate> {
    UIDatePicker *datePicker;
    UIDatePicker *datePicker2;
    ThePreviewViewController *_thePreview;
}
@property (nonatomic, retain) IBOutlet UITextField *toName;
@property (nonatomic, retain) IBOutlet UITextField *fromName;
@property (nonatomic, retain) IBOutlet UITextField *issue;
@property (nonatomic, retain) ThePreviewViewController *thePreview;
@property (nonatomic, retain) IBOutlet UITextField *expire;
@property (nonatomic, retain) IBOutlet UITextField *loveMessage;
@property (nonatomic, retain) IBOutlet UITextField *gift;
-(IBAction)build;
@end

The implementation file is:

#import "ThePreviewViewController.h"
@implementation CreateViewController
@synthesize toName, fromName, gift, loveMessage, issue, expire, datePicker, datePicker2;
@synthesize thePreview = _thePreview;

-(IBAction)preview {
    if (_thePreview == nil) {
        self.thePreview = [[ThePreviewViewController alloc] initWithNibName:@"ThePreviewViewController" bundle:[NSBundle mainBundle]] ;
    }
    _thePreview.issue.text = issue.text;
    _thePreview.gift.text = gift.text;
    _thePreview.expire.text = expire.text;
    [self.navigationController pushViewController:_thePreview animated:YES];



}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

However, after I connect all the outlets, the labels in ThePreviewViewController stay at null. Thoughts?

  • 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-18T01:08:13+00:00Added an answer on June 18, 2026 at 1:08 am

    It looks like this is due to an issue which has been discussed here before: when you instantiate your ThePreviewViewController its UIKit instances are not yet available to have their properties set.

    The solution is to create and set NSString properties on your ThePreviewViewController (or more compactly use an NSDictionary) which then use, in its ViewWillAppear event handler to set the properties of its UIKit elements.

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

Sidebar

Related Questions

I'm trying to take values from a table and put them into a string
I'm trying to take a text string, (e.g. the word testing) and calculating if
Context: I'm trying to do is to make a program which would take text
I am trying to take a line of text like 13) Check for orphaned
trying to take this content: <div class=content>one,two,three</div> <div class=content>four,five,six</div> <div class=content>seven,eight,nine</div> and .split and
I have written two methods that take and return a string. One converts from
I'm trying to take a {variable} string and cut it down for entry into
I am trying to pass a string back and forth between the view Controllers,
I'm trying to take a user input, turn it into a JS variable, and
I'm trying to implement a replacement for raw_input() that would use a configurable text

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.