单击主页按钮时应用程序崩溃

时间:2014-10-19 22:47:32

标签: objective-c ios7 app-store

我有一个惊吓崩溃的场景来崩溃应用程序! 当您通过从Xcode运行应用程序进行全新安装时;应用程序将完美运行。 但是我从应用程序商店安装了当前应用程序,然后运行应用程序,现在一切都很完美,直到你点击主页按钮,应用程序将在那一刻崩溃!问题是什么?我怎么能解决它?

更新(这是日志):

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x6f687370
Triggered by Thread:  0

Thread 0 name:  Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0   ???                             0x6f687370 0 + 1869116272
1   CoreFoundation                  0x291ad93c _CFXNotificationPost + 1784
2   Foundation                      0x29edd9b8 -[NSNotificationCenter postNotificationName:object:userInfo:] + 72
3   UIKit                           0x2c99b7ae -[UIApplication _handleApplicationDectivationWithScene:shouldForceExit:transitionContext:completion:] + 882
4   UIKit                           0x2c9a29f0 __88-[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:]_block_invoke + 76
5   UIKit                           0x2c9a299c -[UIApplication _handleApplicationLifecycleEventWithScene:transitionContext:completion:] + 360
6   UIKit                           0x2c997c82 -[UIApplication scene:didUpdateWithDiff:transitionContext:completion:] + 478
7   FrontBoardServices              0x2f9a21f8 __80-[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:]_block_invoke_2 + 40
8   FrontBoardServices              0x2f9b10e8 __31-[FBSSerialQueue performAsync:]_block_invoke + 12
9   CoreFoundation                  0x2925f5b4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
10  CoreFoundation                  0x2925e878 __CFRunLoopDoBlocks + 216
11  CoreFoundation                  0x2925d3b2 __CFRunLoopRun + 1714
12  CoreFoundation                  0x291ab620 CFRunLoopRunSpecific + 476
13  CoreFoundation                  0x291ab432 CFRunLoopRunInMode + 106
14  GraphicsServices                0x305310a8 GSEventRunModal + 136
15  UIKit                           0x2c796358 UIApplicationMain + 1440
16  MyNiceTestApp                   0x000cae9e 0xc4000 + 28318
17  libdyld.dylib                   0x371bfaae start + 2

2 个答案:

答案 0 :(得分:2)

由于没有源代码可以查看我的猜测,你已经注册了 NSNotificationCenter的观察员,你没有删除观察员 申请终止。

如果将NSNotification发送到已解除分配,则会导致问题 监听器。

答案 1 :(得分:1)

UIApplicationDidEnterBackgroundNotification 通知