解雇ModalViewControllerAnimated后将参数设置为超级视图
我有 2 个视图(视图 A 和视图 B)。
在 viewA 中,当我触摸按钮时,我执行此代码来翻转 viewB:
viewB.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:viewB animated:YES];
现在,当我回到 viewA 时,我使用此代码:
[self dismissModalViewControllerAnimated: YES]; //here is my problem
当我执行关闭时,我需要为 viewA 设置相同的参数。 我该怎么做呢?
编辑 我还没有找到任何解决方案,我以这种方式使用了pushNavigation:
FirstViewController *viewA = [self.storyboard instantiateViewControllerWithIdentifier:@"myView"];
// Effettuo il push alla view successiva
[self.navigationController pushViewController:viewA animated:YES];
I have 2 view (view A and view B).
In viewA when I touch a button I execute this code to flip a viewB:
viewB.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:viewB animated:YES];
And now when I came back to viewA I use this code:
[self dismissModalViewControllerAnimated: YES]; //here is my problem
I need to set same parameters to viewA when I execute dismiss.
How can I do it?
EDIT
I have not found any solution and I used a pushNavigation in this way:
FirstViewController *viewA = [self.storyboard instantiateViewControllerWithIdentifier:@"myView"];
// Effettuo il push alla view successiva
[self.navigationController pushViewController:viewA animated:YES];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
搜索委托示例或简单地使用 NSNotificationCenter 将消息从一个视图发送到另一个
视图 ClassA:
ClassB:
search for a delegate example or simply use NSNotificationCenter to send a message from one view to another
ClassA:
ClassB:
您有两个选择:
1- 您可以使用委托模式 并将 viewA 注册为委托对象:
在 viewB 中,您可以向委托发送消息:
2- 您可以在 viewB 中保留指向 viewA 的指针:
然后您可以直接向 viewA 发送消息:
You have two options:
1- You can use the delegate pattern and register viewA as the delegate object:
And in viewB you can send messages to the delegate:
2- You can keep a pointer to viewA in viewB:
And then you can send messages to the viewA directly: