_UIFallbackPresentationViewController

▼魔方 西西 提交于 2019-12-03 13:53:48

Finally found an answer for this. When the dictionary gets presented by the system, its window gets focus (see makeKeyAndVisible: in UIWindow), which is great. The problem comes when dismissing where the window holding the dictionary doesn't properly give the main application window back focus.

If you print out the [UIApplication sharedApplication].keyWindow before and after the dictionary gets presented then you'll see how before your application window was keyAndVisible and afterwards it is a different window. For me, I had a separate window for app messages that lived on top of the status bar, and that one was what was keyAndVisible after the dictionary was dismissed.

So all I had to do to fix it was have the following override method in my UIWindow subclass that incorrectly received focus:

- (void) makeKeyWindow {
  AppDelegate * appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  [appDelegate.window makeKeyAndVisible];
}

I'm not sure how this will work for those if you without your own UIWindow that gets focused on, but absolute worst case you could add a dummy UIWindow that would receive focus and add the exact same piece of code from above.

The error message suggests you start a transition but the call to the corresponding end method is missing.

  • Have you tried doing the transition without animation? (animated: NO)

  • Sometimes this behavior appears when using a switch statement and forgetting the break;

  • If you are performing a seque, do it in -viewDidAppear instead of -viewWillAppear

Hope it helped a bit! :)

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