trouble with displaying another UIWindow

会有一股神秘感。 提交于 2019-12-04 14:45:36

If you're in ARC code your window is getting deallocated immediately after showOtherWindow: returns. Try assigning otherWindow to an ivar in a persistent object.

Assign the window's pointer to a __strong instance variable (ivar) or a strong property. Set the ivar or property to nil after you dismiss the window.

In iOS you have one window that fills all the screen. To do what you want you may create a UIViewController/UIView and open it in modal mode.

From your main View Controller you may do something like

UILoginViewController *login = [[UILoginViewController alloc] init]; 
login.modalPresentationStyle = UIModalPresentationFormSheet; // or whatever you prefer

login.completionWithItemsHandler = hdl;

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