سؤال

My UIViewController subclass has a valid "- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender" defined, the segue is listed as a connection from the UIBarButtonItem to the destination controller, but prepareForSegue is never triggered. The button animates that a tap has occurred though.

There is also no additional action connected to the button that I have defined. Is there a special way to handle UIBarButtonItems?

هل كانت مفيدة؟

المحلول

In the action for the button, try calling this method:

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

This should trigger the prepareForSegue method.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top