Ome*_*mer 7 objective-c uiactionsheet uisplitviewcontroller ios5.1
我有一个基于UISplitViewController的应用程序,它在Split的MasterViewController中显示一个ActionSheet.在iOS 5.1之前,我在分割显示的弹出窗口中显示操作表没有任何问题,但现在,显然新的"滑入式"方式显示MasterController有问题.
问题在于,当我尝试使用任何[actionSheet show ..]方法呈现ActionSheet时,应用程序崩溃并出现以下错误(确切的断言如下).
*** Assertion failure in -[UIActionSheet presentSheetInPopoverView:], /SourceCache/UIKit_Sim/UIKit-1914.84/UIActionSheet.m:1816
sharedlibrary apply-load-rules all
Error in re-setting breakpoint 1:
Catchpoint 2 (throw)Error in re-setting breakpoint 1:
Error in re-setting breakpoint 1:
Current language: auto; currently objective-c
Run Code Online (Sandbox Code Playgroud)
我谷歌这一段时间,但没有实质性答案..有人说它可能是新的SplitViewController中的一个错误...
想法?
先感谢您!
更新:我发布了一个可能的通用解决方法,检查出来.如果它适合你,请发表评论....如果没问题,我会在几天后将其标记为正确
我也有同样的问题。
至少可以防止崩溃的一种解决方法是显示您的 UIActionSheet,如下所示:
if (UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
[self.actionSheet showFromBarButtonItem:sender animated:YES];
} else {
[self.actionSheet showInView:self.view.window];
}
Run Code Online (Sandbox Code Playgroud)
因此,在纵向模式下,操作表显示在窗口的中央。不太理想,但至少不会崩溃。当处于横向模式时,它的行为正常。
| 归档时间: |
|
| 查看次数: |
1718 次 |
| 最近记录: |