1 つのアプリを作成したいのですが、フォームの送信が含まれています。この中で私は単一のビュー アプリケーションによって 1 つの新しいプロジェクトを作成します。この firstViewController にボタンを配置し、それを押すと、secondViewController にリダイレクトされます。
これで私はフォームを持っています。ユーザーからデータを取得し、送信ボタンを使用して、これを thirdViewController にリダイレクトし、フォーム データを thirdViewController に出力したいと考えています。
私が書いたfirstViewController.mファイルに
-(IBAction)nextVCButton:(id)sender
{
SecondViewController *tempView = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
NSLog(@"name : %@",self.nameTextField.text);
tempView.fullName = self.nameTextField.text;
[tempView setFullName:self.fullName];
[self.view addSubview:tempView.view];
}
SecondViewController.m ファイル内
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
NSLog(@"received info %@", [self.fullName description]);
self.nameLabel.text = [self.fullName description];
}
ログでは (name :) 値を取得していますが、secondViewController で受信した情報は null です。
私は xib ファイルを使用してこれをすべて行っています。ストーリーボードは使用しません。
このフォームデータを secondViewController に取得するのを手伝ってください。
ありがとう。