- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
我的应用程序崩溃了,一定是因为 UIAlertController。
此问题仅发生在 UIAlertController 可用的 iOS 8.x 上。奇怪的是,我的应用程序既不使用 UIAlertViewController 也不使用 UIAlertView。
报告告诉我:
Trying to dismiss UIAlertController <UIAlertController: 0x172c5d80> with unknown presenter.
这怎么会发生?
我想过
但这些案例中没有一个让我崩溃。
崩溃日志告诉我的事实是,操作系统显示了一个将附加到我的应用程序窗口的 AlertView,并且在某些情况下会松开显示 UIAlertViewController 的父 View Controller 。
有什么想法可以找到问题吗?
这里是堆栈跟踪
_________________________________
0 CoreFoundation 0x2bc0c45f __exceptionPreprocess + 127
1 libobjc.A.dylib 0x39c79c8b objc_exception_throw + 36
2 CoreFoundation 0x2bc0c3a5 +[NSException raise:format:] + 110
3 UIKit 0x2f4ad13d -[UIAlertController _dismissAnimated:triggeringAction:triggeredByPopoverDimmingView:] + 414
4 UIKit 0x2f4acf97 -[UIAlertController _dismissAnimated:triggeringAction:] + 28
5 UIKit 0x2f590a0b -[_UIAlertControllerActionView touchesEnded:withEvent:] + 160
6 UIKit 0x2f159567 -[UIWindow _sendTouchesForEvent:] + 520
7 UIKit 0x2f152e31 -[UIWindow sendEvent:] + 542
8 UIKit 0x2f129759 -[UIApplication sendEvent:] + 194
9 UIKit 0x2f39d2f9 _UIApplicationHandleEventFromQueueEvent + 14166
10 UIKit 0x2f1281a9 _UIApplicationHandleEventQueue + 1350
11 CoreFoundation 0x2bbd2fbf __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
12 CoreFoundation 0x2bbd23cf __CFRunLoopDoSources0 + 216
13 CoreFoundation 0x2bbd0a35 __CFRunLoopRun + 770
14 CoreFoundation 0x2bb1e3b1 CFRunLoopRunSpecific + 474
15 CoreFoundation 0x2bb1e1c3 CFRunLoopRunInMode + 104
16 GraphicsServices 0x3308d201 GSEventRunModal + 134
17 UIKit 0x2f18843d UIApplicationMain + 1438
18 MyApp 0x00028a07 main (main.mm:16)
编辑
holes 询问我的窗口初始化。这是我的 AppDelegate 的代码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[MyAppCustomWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
_mainViewController = [[MyAppContainerViewController alloc] initWithNibName:nil bundle:nil];
_mainStatusBarVC = [[MyAppStatusBarVC alloc] initWithRootVC:_mainViewController];
[self.window setRootViewController:_mainStatusBarVC];
[self.window makeKeyAndVisible];
return YES;
}
最佳答案
我敢打赌你的崩溃发生在 iPad 上。
在 iPad 上,从 iOS8 开始,UIActionSheet 似乎由 UIAlertController
处理
有了这段代码,
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if(buttonIndex == 1) return; // Cancel button
[self doSomeViewControllerDismisses];
}
我的应用程序崩溃并出现与您遇到的相同的错误。
为了防止这种情况,我只是在下一次 MainThread 执行时调度复杂的关闭调用,为隐藏的 UIAlertViewController
提供正确释放的机会。
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if(buttonIndex == 1) return; // Cancel button
dispatch_async(dispatch_get_main_queue(), ^{
[self doSomeViewControllerDismisses];
});
}
关于ios - 试图用未知的演示者解雇 UIAlertController,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29649223/
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
在这个abc.php文件中写入如下代码。 ? 1
就目前而言,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引起辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the he
我喜欢用 dotvvm 建立一个视频演示网站。当什么都没有发生时,每次从列表中播放新视频时它都必须开始。使用 bootstrap/MediaObject 我找不到“视频准备播放”事件,因此我们可以开始
我正在开发一个拼贴应用程序,为此我使用DKImagePickerController一次选择多个图像。 pod 的 Github 链接是 https://github.com/zhangao0086/
我试图证明 move 构造函数在消除不必要的复制方面的有用性。但是,当我在 Release 中运行时,Visual Studio 优化器会忽略拷贝。当 move 构造函数不可用时不会调用复制构造函数,
我正在尝试用我自己的测试项目重新创建 HornetQ 示例。但是我遇到了类加载器问题。显然,我缺少文档中未指定的一些依赖项。 文档让我添加 hornetq-core-client.jar netty.
这如何在 Markdown 中完成? 我在 Rmarkdown 中使用投影仪演示文稿,我想要幻灯片左侧的图像和幻灯片右侧的文本。 基本上,这是做什么的:https://tex.stackexchang
有时您需要创建一个 非常 Qt4 中的简单单文件应用程序。然而这是有问题的,因为你总是在做 CPP/H 分离,然后 main() 在另一个文件中...... 任何想法如何在单个文件中执行此操作?尽快弄
有很多关于 SAPUI5 拆分应用程序的演示、教程和文档,但我找不到大量非拆分应用程序的演示。哪里可以买到吗? 为什么如此关注拆分应用程序?它们非常适合移动设备,但我认为桌面应用程序不需要它们。 主视
我的页面 div#posts 下的部分根据脚本结果进行更新。这是一个老式的 mysql 选择查询,回显所有结果标签。 例如foreach($输出为$view) echo “{$view['smthin
ReportLab 用户指南中说: The colortest.py script in reportlab/demos/colors demonstrates thedifferent ways i
ReportLab 用户指南中说: The colortest.py script in reportlab/demos/colors demonstrates thedifferent ways i
我从 git 下载了 PF 演示:https://github.com/primefaces/showcase 并运行 mvn package,但收到以下消息: martin@MyUbuntu:~/
我看过一些程序显示惊人的高度详细的 3d 场景和配乐,但让我震惊的是它们都小于 64kB!这些程序如何运作? 最佳答案 他们按程序生成内容。即他们不添加 3d 模型、位图、基于样本的音频文件,...而
我想让这个休息服务工作: http://www.vogella.de/articles/REST/article.html 在3.4章节,我想运行服务,但是好像不可用。我从教程中复制粘贴了代码。 To
有人可以向我指出 JFreeChart 的 XYSplineRenderer 的工作示例吗? 最佳答案 虽然我从未见过该示例,但XYSplineRendererDemo1.java 是一个可以在dem
我已经下载并解压了 Havok demos ,但该项目依赖于一个文件夹: $(HAVOK_SDKS_DIR)/win32/dx/Include 但它没有设置 HAVOK_SDKS_DIR(没有安装程序
我已经检查了 10 种方法,为什么使用谷歌地图的简单应用程序不能工作,但我没有任何正确的解决方案。我还尝试运行位于 ...\android-sdks\extras\google\google_play
我已经从 oracle 下载中下载了 Swingset2 和 SwingSet3 演示文件(来自“使用 Swing 创建 GUI”教程)(并将它们解压缩/解压到用于 NetBeans 编译器的工作区)
我是一名优秀的程序员,十分优秀!