UIViewController dismissViewControllerAnimated: completion: causes app to freeze

ε祈祈猫儿з 提交于 2019-12-25 05:27:18

问题


The setup I have on the iPad is a UISplitViewController that handles the main content of the app. This is set to the rootViewController of the UIWindow.

When the app launches, I test to see if the user is able to login to the web service. If the user isn't able to access the web service they are presented with a UIViewController subclass which handles the authentication for the user. The UIViewController subclass is presented modally by calling: [splitViewController presentViewController:loginViewController animated:YES completion:nil];

When the user successfully logs in, the loginViewController is dismissed by calling: [splitViewController dismissViewControllerAnimated:YES completion:nil];

Using reveal app (http://revealapp.com) I'm able to see that the splitViewController is now being presented modally rather than as expected.

As a result of the splitViewController being presented modally, it now doesn't accept any input from the user.

Has anyone come across this scenario before and is able to help me out.

UPDATE:

The problem looks like it is to do with a UIAlertView that gets presented when the login is being attempted. This appears between when the user taps on "Login" and the login is verified. Does anyone know why / how this would be causing a problem? Either the UIAlertView isn't being dismissed properly or the LoginViewController isn't.

Thanks,

Matt.


回答1:


I think what you wanted was:

[loginViewController dismissViewControllerAnimated:YES completion:nil];

instead of

[splitViewController dismissViewControllerAnimated:YES completion:nil];


来源:https://stackoverflow.com/questions/17310999/uiviewcontroller-dismissviewcontrolleranimated-completion-causes-app-to-freeze

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