【发布时间】:2017-02-22 23:29:48
【问题描述】:
有类似的问题,但它们要么很快,要么没有解决我的问题。
我有一个视图控制器,当单元格确实按下选择按钮时,它会显示导航视图控制器:
patientBillNavigationViewController *viewController = [self.storyboard instantiateViewControllerWithIdentifier:@"PatientBillVC"];
//soem value assignment
[self presentViewController:viewController animated:YES completion:nil];
您可以说计费打开了一个全新的视图,独立于主应用流程来处理计费流程。
此导航视图控制器自动加载的视图是帐单视图,现在如果我想将此视图控制器中的值传递给嵌入导航视图中的另一个视图控制器,我不能这样做。如何传递一个值?
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
PatientBillViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"PBVC"];
vc.superBillToAddEdit = sb;
//then display the view embedded in navigation view
但这不起作用。
【问题讨论】:
-
你为什么不使用
delegate protocol呢?在呈现之前将视图控制器设置为PatientBillViewController的代表。
标签: ios objective-c uinavigationcontroller storyboard