通过 SWRevealViewController 将参数从一个 ViewController 传递到另一个 ViewController。这不是关于在 Front Controller 和 Rear Controller 之间传递参数,而是从另一个 ViewController (firstViewController) 到 front (frontViewController。参见图片以供参考。segue (on button touch) 尝试将字符串值传递给前端控制器
图片在这里: http: //portwire.com/stackoverflow/storyboard.png
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
SWRevealViewController *destinationViewController = (SWRevealViewController *)segue.destinationViewController;
UINavigationController *navegationController = (UINavigationController *)destinationViewController.frontViewController;
//UUPS!! SWRevealViewController.frontViewController is nil
//How to access destination UIViewController????????
FrontViewController * frontViewController = (FrontViewController *)navegationController.topViewController;
frontViewController.fromString = @"String from previous view";
}