简体   繁体   中英

Is it possible to PerformSegueWithIdentifier and make the sender a different viewcontroller

Not sure it is possible but I want to

 [self performSegueWithIdentifier:@"ToAController" sender:SomeOtherViewController];

I may not be doing this even close to right but I would like to do this so my navigation flow works correctly (as in doesnt go back to "ToAController" but instead would go back to "SomeOtherViewController)

EDIT

For clarification of my navigation flow

the letters and numbers are views

1->2

1->A->2

1<-2

B<-2

1<-A

I dont want anything to go back (have a back button to 'A'

The sender can be any kind of object, the sender will be received in the - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender method of the view controller that calls the performSegue method.

Another thing I don't know what you try to say by go back but if you want to go back to a view controller that is already added in the navigationController stack then you should use the pop methods of the UINavigationController instead of segues because a segue will perform only push/modal/custom operations which will add the destinationController to the UINavigation controller stack.

EDIT

Form iOS 6 there is a new type of segue called unwind that can be linked to the green Exit icon of a View Controller in storyboard. And because I don't want to steal votes from other beloved SO members here is a good thread regarding unwind segues What are Unwind segues for and how do you use them?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM