Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
209 views
in Technique[技术] by (71.8m points)

ios - UIViewController dismissViewControllerAnimated: completion: causes app to freeze

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I think what you wanted was:

[loginViewController dismissViewControllerAnimated:YES completion:nil];

instead of

[splitViewController dismissViewControllerAnimated:YES completion:nil];

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...