Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 从另一个UIViewController文本框获取文本框的值_Iphone_Cocoa Touch_Uitextview_Viewcontroller - Fatal编程技术网

Iphone 从另一个UIViewController文本框获取文本框的值

Iphone 从另一个UIViewController文本框获取文本框的值,iphone,cocoa-touch,uitextview,viewcontroller,Iphone,Cocoa Touch,Uitextview,Viewcontroller,我有一个视图1,其中有一个与PickerView链接的文本框。 我有一个带有文本框的视图2。 视图1通过模态序列与视图2链接 如何将textbox.View1中的值用于texbox.View2?第一个视图控制器应实现prepareforsgue:并为第二个视图控制器提供所需的值: -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualTo

我有一个视图1,其中有一个与PickerView链接的文本框。 我有一个带有文本框的视图2。 视图1通过模态序列与视图2链接


如何将textbox.View1中的值用于texbox.View2?

第一个视图控制器应实现prepareforsgue:并为第二个视图控制器提供所需的值:

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    if ([[segue identifier] isEqualToString:@"TheSegueThatTriggersViewController2"]) {
        ViewController2 *vc2 = (ViewController2 *)segue.destinationViewController;
        vc2.vc2TextBox.text = self.vc1TextBox.text;
    }
}