我正在开发要在其中显示弹出框的应用程序
- (void)applicationWillEnterForeground:(UIApplication *)application
应用程序委托功能,但应用程序抛出异常
"'NSInvalidArgumentException', reason: 'Popovers cannot be presented from a view which does not have a window.'".
我打电话给popOver
喜欢
[popOver presentPopoverFromRect:self.rootViewController.view.frame inView:self.rootViewController.view permittedArrowDirections:0 animated:YES];
如果我更改代码
[popOver presentPopoverFromRect:self.rootViewController.view.frame inView:self.window permittedArrowDirections:0 animated:YES];
代码工作正常。那么popOver
在 appdelegates 窗口中显示是否正确?