如何将 MFMessageComposeViewController 解除为 mainView 控制器?
假设我有两个控制器 A & B 和 1 MFMessageComposeViewController。 我正在执行这些操作
A->当前ModalViewController -> B
B->当前ModalViewController -> MFMessageComposeViewController 对象
因此,在消息撰写 didFinishWithResult
委托上,我想返回到 A 控制器而不是 B 上
。我已经尝试了几个步骤,例如委托中的 2 次解雇ModalViewControllerAnimated 以及直接从委托调用 A 控制器,但没有任何效果。每次它只解除一次并保留在 B 控制器上。
取消/发送时我想返回到 A 控制器。
Lets say I have two controller A & B and 1 MFMessageComposeViewController.
I am performing these operations
A-> presentModalViewController -> B
B-> presentModalViewController -> MFMessageComposeViewController object
So on message compose didFinishWithResult
delegate I want to go back to A Controller not on B.
I have tried several steps like 2 times dismissModalViewControllerAnimated in delegate and calling A controller directly from delegate but nothing its working. Everytime it dismisses only single time and it remains on B controller.
On cancel/send i want to go back to A controller.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如您提到的,将其驳回两次。
首先,
[selfmissModalViewControllerAnimated:NO];
然后,
[selfdismissModalViewControllerAnimated:YES];
As you mentioned, dismiss it twice.
First with,
[self dismissModalViewControllerAnimated:NO];
Then,
[self dismissModalViewControllerAnimated:YES];
方法 1:当您呈现给 MFMessageComposeViewController 时,在 B 控制器中设置一个标志。在您 B 的视图中将出现检查是否设置了标志,然后关闭 B 并取消设置标志。
方法 2:在呈现 MFMessageComposeViewController 之前关闭 B
Method 1: In your B controller set a flag when you present to MFMessageComposeViewController. In your B's view will appear check if the the flag is set then dismiss B and unset the flag.
Method 2: dismiss B just before presenting MFMessageComposeViewController