__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ 18 23 CoreFoundation崩溃

时间:2013-07-31 11:46:18

标签: ios multithreading crash

我遇到了崩溃。有人能告诉我这次事故的原因吗?

__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

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

1 个答案:

答案 0 :(得分:7)

使用NSNotificationCenter

时会发生此崩溃

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

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

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

viewWillDisappear

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