0
我正在使用SWRevealViewController構建側欄菜單。 我有這種方法來從菜單(UITableView)中選擇一個元素時選擇正確的控制器。 segue標識符/名稱是在故事板中配置的。prepareForSegue從未打電話
- (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender
{
NSLog(@"Tapped");
// Set the title of navigation bar by using the menu items
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
UINavigationController *destViewController = (UINavigationController*)segue.destinationViewController;
destViewController.title = [[_menuItems objectAtIndex:indexPath.row] capitalizedString];
// Set the photo if it navigates to the PhotoView
if ([segue.identifier isEqualToString:@"showToday"]) {
[segue destinationViewController];
}
if ([segue.identifier isEqualToString:@"showCountries"]) {
[segue destinationViewController];
}
if ([segue isKindOfClass: [SWRevealViewControllerSegue class]]) {
SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;
swSegue.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) {
UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
[navController setViewControllers: @[dvc] animated: NO ];
[self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
};
}
}
但從側欄菜單中選擇項目時沒有任何反應。可能是什麼問題?感謝您的幫助。