Two ModalViewController

巧了我就是萌 提交于 2019-12-01 08:50:19

You must call the second dismiss with a delay, because the first dismiss hasn't been done yet when called.

[self performSelector: @selector(finish:) withObject: obj afterDelay: 0.0f];

A delay of 0.0f is intentional, it means it will be done in the next event loop.

I had a similar problem. I had a stack of modally presented view controllers. When I tried to dismiss them starting with the visible one, and moving down the stack, I would fail with the same error. The solution was to dismiss the view controller at the bottom of the stack. It would dismiss everything above it.

In your case, my solution would amount to changing the mailComposerController method so that it contains only one line (does not dismiss the top-most modal vie controller).

[self.delegate finishAddList:checkmark andListName:listName.text];

I know you've resolved your problem already, but thought this might be helpful for others.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!