1. Code jump, VC interface needs to be written on Xib
Uiviewcontroller *VC = [[Uiviewcontroller alloc] init];//General Controller
[Self PRESENTVIEWCONTROLLER:VC animated:yes completion:nil];
2.storyboard button Jump, no connection, can also pass value
-(Ibaction) ItemClick: (ID) Sender {
Uiviewcontroller *three = [[Uistoryboard storyboardwithname:@ "Main" Bundle:nil] instantiateviewcontrollerwithidentifier:@ "three"];
[Self presentviewcontroller:three animated:yes completion:nil];
}
3.storyboard Drag the first Controller button directly to the second controller to select Show. Click to jump
4.storyboard two controllers connected, with a segue setting identifier, jump through code:
[Self performseguewithidentifier:@ "segue" sender:self];
And you can pass the value by Prepareforsegue: method.
-(void) Prepareforsegue: (Uistoryboardsegue *) Segue Sender: (ID) Sender {
Segue.identifier: Get the ID of the connection
if ([Segue.identifier isequaltostring:@ "Sendvalue"]) {
Segue.destinationviewcontroller: Gets the interface (VC) referred to in the connection
Receiveviewcontroller *receive = Segue.destinationviewcontroller;
Receive.name = @ "Garvey";
Receive.age = 110;
There is no need to specify a jump, as there is already a jump code in the button-down event
[Self.navigationcontroller pushviewcontroller:receive Animated:yes];
}
}
Jump between controllers