【发布时间】:2015-02-13 13:37:24
【问题描述】:
我在我的 Swift 项目中使用 PayPal iOS SDK。
当我在 NavigationBar 中使用 BarButtonItem 解除标准 PayPalPaymentViewController 时,我在控制台中收到以下错误:
(lldb) 为绿色,仅此而已。
我尝试在控制台的输出下方输入bt:
* thread #1: tid = 0x271b32, 0x00000001951fc0b4 libobjc.A.dylib`objc_retain + 20, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x1625f6c90)
frame #0: 0x00000001951fc0b4 libobjc.A.dylib`objc_retain + 20
frame #1: 0x0000000100215e0c MyApp`-[UIBarButtonItem(TLBarButtonItem) tl_barButtonAction:] + 32
frame #2: 0x000000010032c1d8 MyApp`-[UIBarButtonItem(PPZebraAnalyticsWidgetCategories) ppZebraAnalyticsWidgetDidTrigger] + 200
frame #3: 0x0000000100215ea4 MyApp`-[UIBarButtonItem(TLBarButtonItem) tl_barButtonAction:] + 184
frame #4: 0x000000018927d418 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 96
frame #5: 0x000000018927d418 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 96
frame #6: 0x000000018926652c UIKit`-[UIControl _sendActionsForEvents:withEvent:] + 612
frame #7: 0x000000018927cdb4 UIKit`-[UIControl touchesEnded:withEvent:] + 592
frame #8: 0x000000018927ca40 UIKit`-[UIWindow _sendTouchesForEvent:] + 700
frame #9: 0x0000000189275f94 UIKit`-[UIWindow sendEvent:] + 684
frame #10: 0x000000018924968c UIKit`-[UIApplication sendEvent:] + 264
frame #11: 0x00000001894e860c UIKit`_UIApplicationHandleEventFromQueueEvent + 14992
frame #12: 0x0000000189247bf4 UIKit`_UIApplicationHandleEventQueue + 1616
frame #13: 0x0000000184a529ec CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
frame #14: 0x0000000184a51c90 CoreFoundation`__CFRunLoopDoSources0 + 264
frame #15: 0x0000000184a4fd40 CoreFoundation`__CFRunLoopRun + 712
frame #16: 0x000000018497d0a4 CoreFoundation`CFRunLoopRunSpecific + 396
frame #17: 0x000000018db175a4 GraphicsServices`GSEventRunModal + 168
frame #18: 0x00000001892aeaa4 UIKit`UIApplicationMain + 1488
* frame #19: 0x00000001005edd50 MyApp`top_level_code + 76 at AppDelegate.swift:17
frame #20: 0x00000001005edd90 MyApp`main + 48 at AppDelegate.swift:0
frame #21: 0x0000000195852a08 libdyld.dylib`start + 4
我对如何解释上述回溯一无所知。
谁能给我一些关于如何找出更多究竟是什么导致错误的指示?如果我需要提供更多信息,请告诉我,我会很乐意添加。
提前感谢您的宝贵时间!
【问题讨论】:
-
您显示的线程表明您正在尝试访问您的代码期望但实际上并不存在的东西。调试器提供了很多无关的信息,但是在您的跟踪中有两件重要的事情:EXEC_BAD_ACCESS 总是意味着您调用的东西不存在(未实例化或已发布),顶部的语句是最近运行的代码在主队列上。因此,您的 tl_barbuttonAction 正在执行或调用的操作存在问题。添加异常断点并在崩溃前检查变量/对象的状态
标签: ios xcode swift lldb taplytics