简体   繁体   中英

presentModalViewController just freezes app

I currently have a design like follows

View1(mainview) creates a view2, sets a reference back to view1 in view2, presents view2

view2 creates a view3, sets view3 to have the same view1 reference, presents view3

view3 then needs to , depending on user selection, call a function on view1, which currently works perfectly and it should then present view1.

The issue is I need a way of showing view1 when view3 is done, so this reference gets passed along and clearly works because the method called on it executes. The issue I have is when trying to present it the app freezes. I also tried creating a new view1, setting it to the reference and presenting that, this causes a freeze too.

What could be the issue? I present it like everything else.

如果你调用presentModalViewController显示视图(如标题所暗示的),你应该叫dismissModalViewControllerAnimatedview3view2显示view1试。

Sorry to answer my own question, but in the end I passed a pointer along the viewController creation and just used this to dismiss the views. eg passing in a sender pointer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM