- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我收到了来自生产环境的崩溃日志,但无法理解如何重现它。根据我掌握的信息,它在装有 iOS 9.3 的 iPad 上只发生过一次。
这次崩溃发生在我发布最新版本之后,我在其中使用了 VIPER 方法论来表达我的一些观点。我在互联网上搜索过,假设我的问题可能是由 Leo Natan 在他的评论中描述的类似问题引起的 here .但我不确定并想知道如何重现和解决问题。我什至不明白显示的是什么弹出窗口。
这是我的崩溃日志(已删除二进制图像):
Incident Identifier: 9476D9A8-1468-4A68-8F71-DA8B7F083172
CrashReporter Key: 21204b1ae5f574c63137a73b5a4a50aeb35fe287
Hardware Model: iPad2,5
Process: CafeManager [24058]
Path: /private/var/containers/Bundle/Application/FF4319BD-9D3B-4178-B5FB-0B4641CB9D6E/CafeManager.app/CafeManager
Identifier: iGlock.CafeManager.com
Version: 1 (1.2.5)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2018-08-27 03:16:59.59 +0300
Launch Time: 2018-08-27 03:04:59.59 +0300
OS Version: iOS 9.3.5 (13G36)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x210df916 __exceptionPreprocess + 122 (NSException.m:162)
1 libobjc.A.dylib 0x2087ae12 objc_exception_throw + 34 (objc-exception.mm:531)
2 UIKit 0x25f4b480 -[UIPopoverPresentationController presentationTransitionWillBegin] + 3336 (UIPopoverPresentationController.m:1201)
3 UIKit 0x259abe8e __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 1794 (UIPresentationController.m:1137)
4 UIKit 0x259a9dae __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 378 (UIPresentationController.m:705)
5 UIKit 0x259034c4 _runAfterCACommitDeferredBlocks + 264 (UIApplication.m:2386)
6 UIKit 0x2590f7d6 _cleanUpAfterCAFlushAndRunDeferredBlocks + 86 (UIApplication.m:2365)
7 UIKit 0x2564db18 _afterCACommitHandler + 80 (UIApplication.m:2416)
8 CoreFoundation 0x210a16c4 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16 (CFRunLoop.c:1620)
9 CoreFoundation 0x2109f9c8 __CFRunLoopDoObservers + 276 (CFRunLoop.c:1716)
10 CoreFoundation 0x2109fdfa __CFRunLoopRun + 954 (CFRunLoop.c:2558)
11 CoreFoundation 0x20fef224 CFRunLoopRunSpecific + 516 (CFRunLoop.c:2814)
12 CoreFoundation 0x20fef010 CFRunLoopRunInMode + 104 (CFRunLoop.c:2844)
13 GraphicsServices 0x225dfac4 GSEventRunModal + 156 (GSEvent.c:2245)
14 UIKit 0x256c3184 UIApplicationMain + 140 (UIApplication.m:3772)
15 CafeManager 0x9973c main + 48 (AppDelegate.swift:20)
16 libdyld.dylib 0x20c9786e tlv_get_addr + 42 (threadLocalHelpers.s:311)
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x20d6ac5c __pthread_kill + 8
1 libsystem_pthread.dylib 0x20e14732 pthread_kill + 62 (pthread.c:1247)
2 libsystem_c.dylib 0x20cff0ac abort + 108 (abort.c:91)
3 libc++abi.dylib 0x20856ae4 abort_message + 108 (abort_message.cpp:47)
4 libc++abi.dylib 0x2086f69e default_terminate_handler() + 266 (cxa_default_handlers.cpp:67)
5 libobjc.A.dylib 0x2087b0b0 _objc_terminate() + 192 (objc-exception.mm:678)
6 libc++abi.dylib 0x2086ce16 std::__terminate(void (*)()) + 78 (cxa_handlers.cpp:67)
7 libc++abi.dylib 0x2086c8f8 __cxa_rethrow + 100 (cxa_exception.cpp:480)
8 libobjc.A.dylib 0x2087af5e objc_exception_rethrow + 42 (objc-exception.mm:581)
9 CoreFoundation 0x20fef2ae CFRunLoopRunSpecific + 654 (CFRunLoop.c:2827)
10 CoreFoundation 0x20fef014 CFRunLoopRunInMode + 108 (CFRunLoop.c:2844)
11 GraphicsServices 0x225dfac8 GSEventRunModal + 160 (GSEvent.c:2245)
12 UIKit 0x256c3188 UIApplicationMain + 144 (UIApplication.m:3772)
13 CafeManager 0x00099740 main + 52 (AppDelegate.swift:20)
14 libdyld.dylib 0x20c97872 start + 2 (start_glue.s:64)
Thread 1 name:
Thread 1:
0 libsystem_kernel.dylib 0x20d6c2f8 kevent_qos + 24
1 libdispatch.dylib 0x20c61d60 _dispatch_mgr_invoke + 256 (source.c:2542)
2 libdispatch.dylib 0x20c61abe _dispatch_mgr_thread$VARIANT$mp + 38 (source.c:2573)
Thread 2:
0 libsystem_kernel.dylib 0x20d6b864 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x20e11b34 _pthread_wqthread + 1036 (pthread.c:1999)
2 libsystem_pthread.dylib 0x20e11718 start_wqthread + 8 (pthread_asm.s:147)
Thread 3:
0 libsystem_kernel.dylib 0x20d6b864 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x20e11b34 _pthread_wqthread + 1036 (pthread.c:1999)
2 libsystem_pthread.dylib 0x20e11718 start_wqthread + 8 (pthread_asm.s:147)
Thread 4:
0 libsystem_kernel.dylib 0x20d6b864 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x20e11b34 _pthread_wqthread + 1036 (pthread.c:1999)
2 libsystem_pthread.dylib 0x20e11718 start_wqthread + 8 (pthread_asm.s:147)
Thread 5:
0 libsystem_kernel.dylib 0x20d6b864 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x20e11b34 _pthread_wqthread + 1036 (pthread.c:1999)
2 libsystem_pthread.dylib 0x20e11718 start_wqthread + 8 (pthread_asm.s:147)
Thread 6:
0 libsystem_kernel.dylib 0x20d6b864 __workq_kernreturn + 8
1 libsystem_pthread.dylib 0x20e11b34 _pthread_wqthread + 1036 (pthread.c:1999)
2 libsystem_pthread.dylib 0x20e11718 start_wqthread + 8 (pthread_asm.s:147)
Thread 0 crashed with ARM Thread State (32-bit):
r0: 0x00000000 r1: 0x00000000 r2: 0x00000000 r3: 0x20cf1b1d
r4: 0x00000006 r5: 0x38084000 r6: 0x372c2304 r7: 0x002b44e8
r8: 0x1778f4e0 r9: 0x208708fd r10: 0x398938a5 r11: 0x1778f504
ip: 0x00000148 sp: 0x002b44dc lr: 0x20e14733 pc: 0x20d6ac5c
cpsr: 0x00000010
Binary Images:
我有一种感觉,当我的 VIPER 模块之一被调用时,可能会发生此崩溃。它应该以这种方式工作:
当前 View Controller (MVC)通过调用此方法组装模块:
class PeriodPickerAssembly: NSObject {
static func assembleModule() -> PeriodPickerRouter {
let router = PeriodPickerRouter()
let presenter = PeriodPickerPresenter()
let viewController = UIStoryboard.init(name: "PeriodPicker", bundle: nil).instantiateViewController(withIdentifier: "PeriodPickerViewController") as! PeriodPickerViewController
viewController.periodPickerPresenter = presenter
presenter.view = viewController
presenter.router = router
router.presenter = presenter
router.view = viewController
return router
}
}
然后方法 choosePeriodWithParams 将 View 显示为弹出窗口:
class PeriodPickerRouter: NSObject, PeriodPickerRouterInterface, PeriodPickerInterface {
weak var presenter: PeriodPickerPresenter!
weak var delegate: PeriodPickerDelegate!
weak var view : UIViewController!
// Ingoing
func choosePeriodWithParams(startDateLimit: Date?, endDateLimit: Date?, currentStartDate: Date?, currentEndDate: Date?) {
view.modalPresentationStyle = .popover
view.popoverPresentationController?.sourceView = UIApplication.topViewController()?.view
appDelegate.window?.rootViewController?.present(view!, animated: true, completion: nil)
presenter.configureDatePickers(startDateLimit: startDateLimit, endDateLimit: endDateLimit, currentStartDate: currentStartDate, currentEndDate: currentEndDate)
}
// Outgoing
func dismissPeriodPicker() {
view.dismiss(animated: true, completion: nil)
}
func periodPickerDidChoosePeriod(startDate: Date, endDate: Date) {
delegate.periodPickerDidChoosePeriod(startDate: startDate, endDate: endDate)
view.dismiss(animated: true, completion: nil)
}}
我认为这两行可能与该问题有关。但不确定如何证明:
view.popoverPresentationController?.sourceView = UIApplication.topViewController()?.view
appDelegate.window?.rootViewController?.present(view!, animated: true, completion: nil)
最佳答案
终于在测试中发现了问题。这是一个愚蠢且众所周知的问题(真丢人,我忘了在 iPad 上正确测试我的应用程序)。但我仍然不明白如何分析该崩溃报告。
错误具有相同的文本,除了行号(没关系,因为代码已更改并且我在使用不同的弹出窗口时遇到了这个问题)。
2018-09-27 22:37:53.952 CafeManager[5235:253337] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIAlertController (<UIAlertController: 0x7fd2a0335c90>) of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001099a6d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109094deb objc_exception_throw + 48
2 UIKit 0x000000010ae3d396 -[UIPopoverPresentationController presentationTransitionWillBegin] + 3407
3 UIKit 0x000000010a5d3f44 __71-[UIPresentationController _initViewHierarchyForPresentationSuperview:]_block_invoke + 2035
4 UIKit 0x000000010a5d1b76 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 309
5 UIKit 0x000000010a46ff62 _runAfterCACommitDeferredBlocks + 317
6 UIKit 0x000000010a483e4c _cleanUpAfterCAFlushAndRunDeferredBlocks + 95
7 UIKit 0x000000010a490147 _afterCACommitHandler + 90
8 CoreFoundation 0x00000001098cbc37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
9 CoreFoundation 0x00000001098cbba7 __CFRunLoopDoObservers + 391
10 CoreFoundation 0x00000001098c17fb __CFRunLoopRun + 1147
11 CoreFoundation 0x00000001098c10f8 CFRunLoopRunSpecific + 488
12 GraphicsServices 0x000000010f54cad2 GSEventRunModal + 161
13 UIKit 0x000000010a463f09 UIApplicationMain + 171
14 CafeManager 0x0000000108227134 main + 68
15 libdyld.dylib 0x000000010dd0992d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
更新:
2018-09-27 22:37:53.952 CafeManager[5235:253337] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Your application has presented a UIAlertController () of style UIAlertControllerStyleActionSheet. The modalPresentationStyle of a UIAlertController with this style is UIModalPresentationPopover. You must provide location information for this popover through the alert controller's popoverPresentationController. You must provide either a sourceView and sourceRect or a barButtonItem. If this information is not known when you present the alert controller, you may provide it in the UIPopoverPresentationControllerDelegate method -prepareForPopoverPresentation.'
Presenting a UIAlertController properly on an iPad using iOS 8
希望对大家有帮助。
关于ios - EXC_CRASH (SIGABRT) UIPopoverPresentationController presentationTransitionWillBegin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52348864/
我的代码在使用 malloc 时遇到问题。直到一个小时前它一直运行良好。它导致这一行 temp2 = (Temp*)malloc(sizeof(Temp));
我的应用程序运行完美,没有任何问题。但是当我尝试调试它时,android studio 卡住了。所以我收到消息“等待调试器”,然后该消息消失,接下来我在模拟器中只看到黑屏。 我也收到了消息 SIGNA
我用 node-js 和 fluent-ffmpeg 编写了一个 node-js api: 'use strict'; require('babel-register'); const path =
我只是在过去一直工作的模拟器上运行我的代码。我真正为启动代码所做的唯一一件事就是设置用户默认值 NSUserDefaults *defaults = [NSUserDefaults standard
我遇到应用程序每次运行时都会在模拟器上崩溃。由于某种原因,他们收到一个中止信号(见附件截图)。最近才开始用,不知道是不是和10.8.4升级有关。 我刚刚基于“单一 View 应用程序”模板创建了一个新
我的应用程序中存在一个错误,使我发疯!尝试隐藏navigationController工具栏后,主线程会收到SIGABRT消息。 [self.navigationController setToolb
我无法理解以下崩溃,因为它是随机发生的,并且我怀疑可能是多线程问题,但是这里是: Incident Identifier: 0BE956AB-228A-4B1B-8A3D-A99A481F7F3F C
我最近设置了 Crashlytics 以从我的 iOS 应用程序接收崩溃日志,并且我不断收到 SIGABRT 崩溃日志,但我找不到它的来源。 如果你能帮我一点,这是崩溃日志: Exception Ty
我正在尝试通过指针来理解这项工作。所以我编写了一个测试程序,其中通过删除分隔点将名称分成标签。每个标签都表示为长度/数据对,如下所示:google.ru 表示为“x\06googlex\02ru”当我
我正在研究教授给我们的一些旧课本,为即将到来的考试做准备,我遇到了这个问题。 我的任务是从结构如下的文本文件中读取信息: [十进制数字],[罗马数字(字符串)],[o 或 u(优化或未优化的罗马数字)
#toggle the string #include int main() { char S[100],ch; int i=0; gets(S); while((S[i]!
我正在开展一个学校项目,我需要从文件中获取矩阵的信息(高度、宽度、单元格状态)。像这样的事情: 30 40 /*height and width*/ 3 /*nr of lines
我学习 Swift 一段时间了,SIGABRT 信号随机出现了好几次。我尝试过一些在线教程,但似乎并不总是有效。 这次我试图用两个 View Controller 设置一个待办事项列表。一个有一个表格
我在我的项目中添加了第二个目标,以便能够对多个应用程序使用相同的 Xcode 项目(基本应用程序的风格略有变化)。我重命名了目标,更改了方案以匹配名称,还重命名了第二个 info.plist。现在,当
我试图运行一个简单的代码,它编译但当我尝试运行它时我得到(核心转储)错误。于是用gdb查看错误是什么。 代码: #include #include #include void gerar() {
我为这个问题苦苦挣扎了 2 天。我有一个解决方法,但我想了解更多会发生什么。让我们开始吧。我有一个非常原始的异常类,它保存一条错误消息作为指向字符数组的指针(我知道 std::string 的利润)。
NSString *aName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)];
我正在尝试从框架动态加载类,但应用程序因转换发送 SIGABRT 信号而崩溃: let newClassType = NSClassFromString("MyFramework.CustomClas
当我运行我的应用程序时, View Controller 中会调用一个函数,当发生这种情况时,我会收到信号 SIGABRT。 如何解决这个问题? 功能: func setRootViewControl
我正在尝试保存 UISwitch 结果并使用它们来填充 Parse.com 推送通知的“ channel ”。我遵循了解析指南,但每次我尝试单击保存开关值的保存按钮时,我都会收到一个 SIGABRT。
我是一名优秀的程序员,十分优秀!