2

我正在崩溃。谁能告诉我这次崩溃的原因?

__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18 23  CoreFoundation  crash

我没有使用线程。NSZombieEnabled 和工具根本没有说明崩溃的原因。请帮我。

0   libobjc.A.dylib                 0x3b0805be objc_msgSend + 30
1   CoreFoundation                  0x3332130c CFRelease + 96
2   CoreFoundation                  0x333fc430 __CFBasicHashDrain + 256
3   CoreFoundation                  0x333213ce CFRelease + 290
4   CoreFoundation                  0x333fc430 __CFBasicHashDrain + 256
5   CoreFoundation                  0x333213ce CFRelease + 290
6   ImageIO                         0x34013008 _CGImagePlusFinalize + 48
7   CoreFoundation                  0x333213ce CFRelease + 290
8   CoreFoundation                  0x333fc430 __CFBasicHashDrain + 256
9   CoreFoundation                  0x333213ce CFRelease + 290
10  ImageIO                         0x34179bb2 releaseInfoPNG + 18
11  ImageIO                         0x34029ae4 ImageProviderReleaseInfoCallback + 32
12  CoreGraphics                    0x3346b1c8 image_provider_finalize + 32
13  CoreFoundation                  0x333213ce CFRelease + 290
14  CoreGraphics                    0x33464f48 image_finalize + 60
15  CoreFoundation                  0x333213ce CFRelease + 290
16  QuartzCore                      0x34fa44ce CA::Layer::State::~State() + 94
17  QuartzCore                      0x34fa7a4e CA::Layer::~Layer() + 290
18  QuartzCore                      0x34fa77ae -[CALayer dealloc] + 138
19  QuartzCore                      0x34f97a70 CA::Layer::free_transaction(CA::Transaction*) + 68
20  QuartzCore                      0x34f960a4 CA::Transaction::commit() + 400
21  QuartzCore                      0x34f95eac CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 56
22  CoreFoundation                  0x333b56ca __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 18
23  CoreFoundation                  0x333b39bc __CFRunLoopDoObservers + 272
24  CoreFoundation                  0x333b3d12 __CFRunLoopRun + 738
25  CoreFoundation                  0x33326eb8 CFRunLoopRunSpecific + 352
26  CoreFoundation                  0x33326d44 CFRunLoopRunInMode + 100
27  GraphicsServices                0x36eea2e6 GSEventRunModal + 70
28  UIKit                           0x3523c2fc UIApplicationMain + 1116

4

1 回答 1

7

使用时发生此崩溃NSNotificationCenter

您将通知观察者注册到已释放且未删除观察者的对象。因此,当它尝试调用选择器时,它会崩溃。

如果您使用某种 ViewController,您可以添加

[[NSNotificationCenter defaultCenter] removeObserver:self name:@"Notification" object:nil];

viewWillDisappear

如果它不是 ViewController,您可以使用它-(void) dealloc来取消注册观察者。

于 2015-03-06T12:38:01.333 回答