Create a new Viewcontroller and Detailviewcontroller
The idetnifier of the VC and DETAILVC lines is set to:GODETAILVC
viewcontroller main code
-(Ibaction) signinbuttontouched: (IDsender {[Self performseguewithidentifier:@"GODETAILVC"sender:self];}#pragmaMark-prepare Segue//A page is passed to page B- (void) Prepareforsegue: (Uistoryboardsegue *) Segue Sender: (IDSender {[Super Prepareforsegue:segue Sender:sender]; if([Segue.identifier isequaltostring:@"GODETAILVC"]) {Detailviewcontroller*DETAILVC =Segue.destinationviewcontroller; Detailvc.passvalue=Self.usernameTextField.text; }}//b page Pass value to page a-(Ibaction) Done: (Uistoryboardsegue *) segue{if([Segue.sourceviewcontroller Iskindofclass:[detailviewcontrollerclass]]) {Detailviewcontroller* svc = (Detailviewcontroller *) Segue.sourceviewcontroller; Self.passwordTextField.text=Svc.textField.text; }}
Done method Detailviewcontroller in storyboard with the Done button action associated to Viewcontroller
1. In the VC page, enter a value in the first TextField click the Sing in button will send the value to Detailviewcontroller TextField display.
2. Change values in Detailviewcontroller TextField Click the Done button to upload the value back to Viewcontroller
If it is the present way to pass the value of Le.
Use the following code to confirm that the value is not feasible
-(void) Prepareforsegue: (Uistoryboardsegue *) Segue sender: (ID) sender { [super Prepareforsegue:segue Sender:sender]; if ([Segue.identifier isequaltostring:@ "godetailvc"]) { *DETAILVC = Segue.destinationviewcontroller; Because this is navigationcontroller, not Detailviewcontroller.
=
}
So the changes are as follows:
// a page value to page B -(void) Prepareforsegue: (Uistoryboardsegue *) Segue sender: (ID) sender{ [Super Prepareforsegue:segue Sender:sender]; if ([[[Segue Identifier] isequaltostring:@ "godetailvc"]) { *viewcontrollerarray = [Segue.destinationviewcontroller viewcontrollers]; *DETAILVC = [Viewcontrollerarray objectatindex:0]; = self.usernameTextField.text; }}
StoryBoard Page Pass Value