how to not call viewdidload in uinavigationcontroller?

后端 未结 3 1432
庸人自扰
庸人自扰 2021-01-29 12:21

I am looking for a solution to my situation. My app is as followed:

On VC1 there is a textfield and button. User types a name. Then click on a button. This button open V

3条回答
  •  自闭症患者
    2021-01-29 13:13

    I am afraid that why you are using push segue to move back.

    Here you need to assing a push segue from VC-A to VC-B and name its identifier like moveForward and button press call

    [self performSegueWithIdentifier:@"moveForward" sender:self]; 
    

    and if any information u want to pass to VC-B pass it in this method

     - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
       {
        if([segue.identifier isEqualToString:@"moveForward"])
        {
            VC-B* vcObject=[segue destinationViewController];
    
            //vcObject.info = your info//etc
        }
       }
    

    In a same way when u have to return to VC-A from VC-B assign a rewind segue from VC-B to VC-A and name its identifier like moveBack and on button press and do the above mention method in VC-B too.

提交回复
热议问题