【问题标题】:iPhone app crashing after a quick stop/restartiPhone 应用程序在快速停止/重启后崩溃
【发布时间】:2011-07-10 20:50:28
【问题描述】:

所以我的应用程序在应用程序停止然后快速重启时崩溃,这是堆栈跟踪:

看起来 UITabBar 正在尝试访问一个为空的视图,因此是 exc_bad_access。我很困惑为什么它只发生在重启时,我的标签栏也是完全在 IB 中创建的。任何想法都会很棒。

异常类型:EXC_BAD_ACCESS (SIGBUS) 异常代码:0x00000000 处的 KERN_PROTECTION_FAILURE 崩溃的线程:0

0x30183f24 objc_msgSend + 24 1 励志名言 0x00009900 0x1000 + 35072

2 UIKit 0x338c37b4 -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 212

3 UIKit 0x338c36cc -[UITabBarController transitionFromViewController:toViewController:] + 32

4 UIKit 0x338c2d38 -[UITabBarController _setSelectedViewController:] + 248

5 UIKit 0x339cbc44 -[UITabBarController setSelectedViewController:] + 12

6 UIKit 0x339cc888 -[UITabBarController _tabBarItemClicked:] + 308

7 CoreFoundation 0x35eada3c -[NSObject(NSObject) performSelector:withObject:withObject:] + 20

8 UIKit 0x3384af18 -[UIApplication sendAction:to:from:forEvent:] + 128

9 UIKit 0x3384ae80 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32

10 UIKit 0x33ab1ed8 -[UITabBar _sendAction:withEvent:] + 416

11 CoreFoundation 0x35eada3c -[NSObject(NSObject) performSelector:withObject:withObject:] + 20

12 UIKit 0x3384af18 -[UIApplication sendAction:to:from:forEvent:] + 128

13 UIKit 0x3384ae80 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32

14 UIKit 0x3384ae48 -[UIControl sendAction:to:forEvent:] + 44

15 UIKit 0x3384aa98 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 528

16 UIKit 0x3388f338 -[UIControl sendActionsForControlEvents:] + 16

17 UIKit 0x33aae560 -[UITabBar(Static) _buttonUp:] + 108

18 CoreFoundation 0x35eada3c -[NSObject(NSObject) performSelector:withObject:withObject:] + 20

19 UIKit 0x3384af18 -[UIApplication sendAction:to:from:forEvent:] + 128

20 UIKit 0x3384ae80 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32

21 UIKit 0x3384ae48 -[UIControl sendAction:to:forEvent:] + 44

22 UIKit 0x3384aa98 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 528

23 UIKit 0x3384b5c4 -[UIControl touchesEnded:withEvent:] + 452

24 UIKit 0x3383cea8 -[UIWindow _sendTouchesForEvent:] + 580

25 UIKit 0x3383c4dc -[UIWindow sendEvent:] + 388

26 UIKit 0x3381fc94 -[UIApplication sendEvent:] + 444

27 UIKit 0x3381f3ac _UIApplicationHandleEvent + 6816

28 图形服务 0x35262c80 PurpleEventCallback + 1040

29 核心基础 0x35e9a5c4 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 22

30 核心基础 0x35e9a582 __CFRunLoopDoSource1 + 158

31 核心基础 0x35e8c82e __CFRunLoopRun + 574

32 CoreFoundation 0x35e8c504 CFRunLoopRunSpecific + 220

33 核心基础 0x35e8c412 CFRunLoopRunInMode + 54

34 图形服务 0x35261d1c GSEventRunModal + 188

35 UIKit 0x33865574 -[UIApplication_run] + 580

36 UIKit 0x33862550 UIApplicationMain + 964

37 励志名言 0x00002b96 0x1000 + 7062

38 条励志名言 0x00002b0c 0x1000 + 6924

【问题讨论】:

    标签: iphone stack-trace uitabbar


    【解决方案1】:

    【讨论】:

    • 如果我通过异常避免崩溃,之后应用程序是否仍然可用?还是 gui 会冻结?
    • @Msencenb GUI 在使用异常处理后不会冻结,只有该部分或方法会跳过您的应用程序尝试访问 NULL 值的位置。
    【解决方案2】:

    您遇到了异常exc_bad_access,我认为您的 nib 文件未正确连接。将您的标签栏与标签栏控制器连接。

    【讨论】:

    • 在我看来,我有一个 TabBarController,它包含/连接到一个标签栏。该标签栏连接了每个 tabbaritem 的所有适当笔尖......所以我认为这不是问题。但也许是?
    • 'exc_bad_access' 显示大量内存泄漏。但在我看来,默认情况下显示选项卡是例外。
    猜你喜欢
    • 1970-01-01
    • 2016-10-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-11-06
    • 1970-01-01
    • 2012-06-04
    • 1970-01-01
    相关资源
    最近更新 更多