iOS 11 EXC_BAD_ACCESS KERN_INVALID_ADDRESS on dealloc - ios

Can't replicate a crash on iOS 11 devices when deallocating the DetailViewController.
The app has a DetailViewController which inherits from the BaseViewController. DetailViewController has a DetailViewModel property.
DetailViewController, BaseViewController and DetailViewModel are all written in Objective-C. I upgraded the Swift version to Swift 4 and added a Swift Extension to DetailViewModel.
#objc extension DetailViewModel {
func foo() {
let conclusionBlock: (() -> Void) = { [weak self] in
guard let strongSelf = self else { return }
strongSelf.viewController.reloadData()
}
let viewModel = OtherViewModel(conclusionBlock: conclusionBlock)
let otherViewController = OtherViewController.make(viewModel: viewModel)
let nav = UINavigationController(rootViewController: otherViewController)
nav.modalPresentationStyle = .fullScreen
viewController.present(nav, animated: true, completion: nil)
}
}
Looking at the logs, func foo() in the DetailViewModel swift extension is not called and it's still crashing on dealloc.
Has anyone got ideas as to what's the issue or how to fix it?
Thank you
stack trace:
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x18589d7f4 objc_object::release() + 16
1 CoreFoundation 0x1862f3108 cow_cleanup + 112
2 CoreFoundation 0x18623a51c -[__NSArrayM dealloc] + 68
3 libobjc.A.dylib 0x18587eef4 object_cxxDestructFromClass(objc_object*, objc_class*) + 148
4 libobjc.A.dylib 0x18588c638 objc_destructInstance + 88
5 libobjc.A.dylib 0x18588c690 object_dispose + 16
6 AppName 0x100c7dbec -[DetailViewModel .cxx_destruct] (DetailViewModel.m:43)
7 libobjc.A.dylib 0x18587eef4 object_cxxDestructFromClass(objc_object*, objc_class*) + 148
8 libobjc.A.dylib 0x18588c638 objc_destructInstance + 88
9 libobjc.A.dylib 0x18588c690 object_dispose + 16
10 AppName 0x100cbe358 -[DetailViewController .cxx_destruct] (DetailViewController.m:103)
11 libobjc.A.dylib 0x18587eef4 object_cxxDestructFromClass(objc_object*, objc_class*) + 148
12 libobjc.A.dylib 0x18588c638 objc_destructInstance + 88
13 libobjc.A.dylib 0x18588c690 object_dispose + 16
14 UIKit 0x18fb338f4 -[UIResponder dealloc] + 156
15 UIKit 0x18f8e9e7c -[UIViewController dealloc] + 1776
16 AppName 0x100c9b66c -[BaseViewController dealloc] (BaseViewController.m:56)
17 AppName 0x100cb6570 -[DetailViewController dealloc] (DetailViewController.m:261)
18 UIKit 0x18f9d3ec4 __destroy_helper_block_.150 + 80
19 libsystem_blocks.dylib 0x185d91a60 _Block_release + 160
20 UIKit 0x18fa5f5bc -[UIViewAnimationBlockDelegate .cxx_destruct] + 72
21 libobjc.A.dylib 0x18587eef4 object_cxxDestructFromClass(objc_object*, objc_class*) + 148
22 libobjc.A.dylib 0x18588c638 objc_destructInstance + 88
23 libobjc.A.dylib 0x18588c690 object_dispose + 16
24 CoreFoundation 0x18623d998 -[__NSDictionaryI dealloc] + 136
25 libobjc.A.dylib 0x18589e138 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 836
26 CoreFoundation 0x186232050 _CFAutoreleasePoolPop + 28
27 CoreFoundation 0x186311b04 __CFRunLoopRun + 2020
28 CoreFoundation 0x1862322d8 CFRunLoopRunSpecific + 436
29 GraphicsServices 0x1880c3f84 GSEventRunModal + 100
30 UIKit 0x18f7df880 UIApplicationMain + 208
31 AppName 0x100d59540 main (main.m:10)
32 libdyld.dylib 0x185d5656c start + 4

To help with replicating the issue, try turning on Address Sanitizer in Xcode 9.

You have an object stored in an array that is over-released when the object is destroyed and is releasing its array.
You can first activate zombie objects (clic your target near the PLAY button, choose scheme/Run/Diagnostics/Zombie objects). in this mode, objects are not really released, so you can query the object causing the crash to see what is its type and begin to track it.

Related

when __NSDictionaryM dealloc crash

For a crash in my application, NSDictionary is an attribute of the model, and when the model executes the cxx_destruct function, crash occurs inside the NSDictionary.There's a place in the crash stack that I'm not sure about cow_cleanup, what's going on in this function?
And The reason for the crash is that during the model release process, NSDictionary changed, right?
Here is the concrete Crash stack
Thread 0 Crashed:
0 libobjc.A.dylib objc_release + 16
1 CoreFoundation cow_cleanup + 168
2 CoreFoundation -[__NSDictionaryM dealloc] + 144
3 imeituan -[CKContent .cxx_destruct] (CKContent.m:12)
4 libobjc.A.dylib object_cxxDestructFromClass(objc_object*, objc_class*) + 112
5 libobjc.A.dylib objc_destructInstance + 88
6 libobjc.A.dylib _objc_rootDealloc + 52
7 imeituan -[CKTableViewCell .cxx_destruct] (CKTableViewCell.m:44)
8 libobjc.A.dylib object_cxxDestructFromClass(objc_object*, objc_class*) + 112
9 libobjc.A.dylib objc_destructInstance + 88
10 libobjc.A.dylib _objc_rootDealloc + 52
11 UIKitCore -[UIResponder dealloc] + 152
12 UIKitCore -[UIView dealloc] + 872
13 UIKitCore -[UITableViewCell dealloc] + 236
14 imeituan -[CKBubbleCell dealloc (CKBubbleCell.m:222)
15 CoreFoundation -[__NSArrayM dealloc] + 228
16 UIKitCore -[UITableView .cxx_destruct] + 1524
17 libobjc.A.dylib object_cxxDestructFromClass(objc_object*, objc_class*) + 112
18 libobjc.A.dylib objc_destructInstance + 88
19 libobjc.A.dylib _objc_rootDealloc + 52
20 UIKitCore -[UIResponder dealloc] + 152
21 UIKitCore -[UIView dealloc] + 872
22 UIKitCore -[UIScrollView dealloc] + 852
23 UIKitCore -[UITableView dealloc] + 364
24 UIKitCore __destroy_helper_block_e8_32s40s + 24
25 libsystem_blocks.dylib _Block_release + 148
26 Foundation -[_NSTimerBlockTarget dealloc] + 44
27 Foundation _timerRelease + 64
28 CoreFoundation __CFRunLoopDoTimer + 936
29 CoreFoundation __CFRunLoopDoTimers + 276
30 CoreFoundation __CFRunLoopRun + 1640
31 CoreFoundation CFRunLoopRunSpecific + 424
32 GraphicsServices GSEventRunModal + 160
33 UIKitCore UIApplicationMain + 1932
34 imeituan main (main.m:38)
35 libdyld.dylib start + 4
Crashes like this are really tricky. The key to keep in mind is that you are crashing during a deallocation. And, more specifically, the crashing function is objc_release. To me, this strongly indicates that you've got an over-released object. It's looks to me like one of your model objects may have already been freed by this point. The issue isn't with the dictionary, directly.
I'd recommend using NSZombies, or one of the other memory allocation tools within Instruments to try to track down where your memory-management issue is.

KVO observer crash on iOS 11

I’ve a app in App Store which was working fine on iOS 10. But recently I’m getting many crash reports and all logs points to KVO crash and all are happening on iOS 11, below is the crash log.
Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x181e7a858 object_isClass + 16
1 Foundation 0x1836d72bc KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED + 68
2 Foundation 0x1836d5ad0 NSKeyValueWillChangeWithPerThreadPendingNotifications + 300
3 QuartzCore 0x186e35024 -[CALayer setDelegate:] + 108
4 UIKit 0x18c866698 -[UIView dealloc] + 708
5 UIKit 0x18c93f08c -[UILabel dealloc] + 192
6 libobjc.A.dylib 0x181e9a13c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 844
7 UIKit 0x18c86678c -[UIView dealloc] + 952
8 CoreFoundation 0x182b911b4 -[__NSArrayM dealloc] + 140
9 libobjc.A.dylib 0x181e9a13c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 844
10 UIKit 0x18c86678c -[UIView dealloc] + 952
11 libobjc.A.dylib 0x181e9a13c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 844
12 UIKit 0x18c86678c -[UIView dealloc] + 952
13 libobjc.A.dylib 0x181e9a13c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 844
14 UIKit 0x18c86678c -[UIView dealloc] + 952
15 UIKit 0x18cbd3248 -[UINavigationTransitionView dealloc] + 96
16 libobjc.A.dylib 0x181e9a13c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 844
17 UIKit 0x18c86678c -[UIView dealloc] + 952
18 UIKit 0x18cbd319c -[UILayoutContainerView dealloc] + 60
19 libobjc.A.dylib 0x181e9a13c (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 844
20 CoreFoundation 0x182b88aac _CFAutoreleasePoolPop + 28
21 UIKit 0x18cc705fc _prepareForCAFlush + 132
22 UIKit 0x18cb555b8 _afterCACommitHandler + 236
23 CoreFoundation 0x182c6a910 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
24 CoreFoundation 0x182c68238 __CFRunLoopDoObservers + 412
25 CoreFoundation 0x182c68884 __CFRunLoopRun + 1436
26 CoreFoundation 0x182b88da8 CFRunLoopRunSpecific + 552
27 GraphicsServices 0x184b6b020 GSEventRunModal + 100
28 UIKit 0x18cb6978c UIApplicationMain + 236
29 MyApp 0x1009bf748 main (main.m:14)
30 libdyld.dylib 0x182619fc0 start + 4
The crashes has crossed over 200 crashes and all are same logs. I’ve not been able to reproduce this crash and kind of stuck on how to proceed next. My entire project is written in objective-C and when I checked there is only one method where I’m using a KVO. Below is a model of my method on how I’ve used it.
-(void)loadData
{
//Some code
if (myAlerts) {
[myAlerts removeObserver:self forKeyPath:#“liveAlerts"];
}
myAlerts = myModel.alerts;
[myAlerts addObserver:self forKeyPath:#"liveAlerts" options:NSKeyValueObservingOptionInitial context:NULL];
}
To remove I use the cleanup method in other viewcontrollers when I no longer need it
-(void)cleanup
{
//Some code
[myAlerts removeObserver:self forKeyPath:#"liveAlerts"];
myAlerts = nil;
}
All the other observers which I've added in my project are NSNotificationCenter observers, could that cause this type of crash log?

How to Resolve "RemoveObjectAtIndex"

I have an property:
#property (nonatomic, retain) QBChatDialog* dialog;
When i make it nil in viewWillDisappear, it giving me error
- (void)viewWillDisappear:(BOOL)animated {
self.dialog = nil;
}
I am getting following error:
-[__NSArrayM removeObjectAtIndex:]: index 2147483647 beyond bounds for empty array'
even i don't use "removeObjectAtIndex". I think this is calling somewhere internally.
How to trace this.
my Complete Stack trace is:
(
0 CoreFoundation 0x05504494 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x05cd6e02 objc_exception_throw + 50
2 CoreFoundation 0x0540b2cd -[__NSArrayM removeObjectAtIndex:] + 445
3 Qboy 0x0026d23e -[TWMessageBarViewController statusBarHidden] + 43262
4 Qboy 0x002acffc QBAFQueryStringPairsFromKeyAndValue + 110104
5 libobjc.A.dylib 0x05cea060 _ZN11objc_object17sidetable_releaseEb + 238
6 libobjc.A.dylib 0x05ce9361 objc_release + 65
7 libobjc.A.dylib 0x05ce9318 objc_storeStrong + 39
8 Qboy 0x0007a35a -[ChatVC .cxx_destruct] + 298
9 libobjc.A.dylib 0x05cd58e2 _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 116
10 libobjc.A.dylib 0x05cd5869 object_cxxDestruct + 20
11 libobjc.A.dylib 0x05cdfcb6 objc_destructInstance + 48
12 CoreFoundation 0x0550e57c -[NSObject(NSObject) __dealloc_zombie] + 156
13 UIKit 0x038de904 -[UIResponder dealloc] + 162
14 UIKit 0x03855e85 -[UIViewController dealloc] + 2296
15 Qboy 0x0017bf93 -[QMChatViewController dealloc] + 835
16 UIKit 0x040c1b75 -[UIViewController(UIKitManual) release] + 88
17 libobjc.A.dylib 0x05ce934f objc_release + 47
18 libobjc.A.dylib 0x05cea52d _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 371
19 CoreFoundation 0x053d48a8 _CFAutoreleasePoolPop + 24
20 CoreFoundation 0x0540c43c __CFRunLoopRun + 2364
21 CoreFoundation 0x0540b846 CFRunLoopRunSpecific + 470
22 CoreFoundation 0x0540b65b CFRunLoopRunInMode + 123
23 GraphicsServices 0x06eef664 GSEventRunModal + 192
24 GraphicsServices 0x06eef4a1 GSEventRun + 104
25 UIKit 0x03688eb9 UIApplicationMain + 160
26 Qboy 0x000db84a main + 138
27 libdyld.dylib 0x062cca25 start + 1
28 ??? 0x00000001 0x0 + 1
)
Please suggest me. What to do?
error tells you that
you have an array which is empty/nil
and after that you are removing an item of object which object is no longer exists in this array
Trick: for quick fix search 'removeObjectAtIndex' all overs the project(from upper left 3rd search button). if find one/lot observe those
You may not be calling removeObjectAtIndex: inside viewWillDisappear:, but you are calling it within -[TWMessageBarViewController statusBarHidden]. Look there and I think you'll find the source of your crash!

Photos Framework crash: 'This application is not allowed to access Photo data.'

App crashes if photo access permission is not granted and the object which asked for permission is about to deallocate.
Apple's sample code (for Photos framework) crashes too.
My app crashes with following stack trace:
*** Terminating app due to uncaught exception 'NSObjectInaccessibleException', reason: 'This application is not allowed to access Photo data.'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a324f65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c030deb objc_exception_throw + 48
2 PhotoLibraryServices 0x000000011c1f7e2d -[PLPhotoLibrary initWithTransientContext:name:] + 1183
3 Photos 0x000000011bd6a445 __30-[PHPhotoLibrary photoLibrary]_block_invoke + 59
4 libdispatch.dylib 0x0000000110f5e49b _dispatch_client_callout + 8
5 libdispatch.dylib 0x0000000110f49e28 dispatch_once_f + 543
6 Photos 0x000000011bd6a404 -[PHPhotoLibrary photoLibrary] + 140
7 Photos 0x000000011bd3e5e8 -[PHCoreImageManager _cancelAndFlushPreheatItemsForAssets:CPLPrefetching:domain:operation:passingTestHandler:didCancelHandler:] + 174
8 Photos 0x000000011bd5900c -[PHImageManager dealloc] + 176
9 libobjc.A.dylib 0x000000010c044afe _ZN11objc_object17sidetable_releaseEb + 232
10 MyApp 0x000000010f271812 _TToFC12MyApp16PhotosDataSourceE + 66
11 libobjc.A.dylib 0x000000010c02f7bb _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127
12 libobjc.A.dylib 0x000000010c03a390 objc_destructInstance + 93
13 libobjc.A.dylib 0x000000010c03a3c3 object_dispose + 22
14 MyApp 0x000000010f271796 _TFC12MyApp16PhotosDataSourceD + 198
15 MyApp 0x000000010f2717c2 _TToFC12MyApp16PhotosDataSourceD + 34
16 libobjc.A.dylib 0x000000010c044afe _ZN11objc_object17sidetable_releaseEb + 232
17 MyApp 0x000000010f2668f2 _TToFC12MyApp25PhotoPickerViewControllerE + 178
18 libobjc.A.dylib 0x000000010c02f7bb _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127
19 libobjc.A.dylib 0x000000010c03a390 objc_destructInstance + 93
20 libobjc.A.dylib 0x000000010c03a3c3 object_dispose + 22
21 UIKit 0x000000010adb54b9 -[UIResponder dealloc] + 130
22 UIKit 0x000000010ad40721 -[UIViewController dealloc] + 1949
23 UIKit 0x000000010ad1c97b -[UIPresentationController .cxx_destruct] + 262
24 libobjc.A.dylib 0x000000010c02f7bb _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127
25 libobjc.A.dylib 0x000000010c03a390 objc_destructInstance + 93
26 libobjc.A.dylib 0x000000010c03a3c3 object_dispose + 22
27 UIKit 0x000000010ad185db -[UIPresentationController dealloc] + 56
28 UIKit 0x000000010b4a9046 -[_UIFullscreenPresentationController dealloc] + 56
29 libobjc.A.dylib 0x000000010c044afe _ZN11objc_object17sidetable_releaseEb + 232
30 UIKit 0x000000010ad1838c __destroy_helper_block_411 + 24
31 libsystem_blocks.dylib 0x0000000110fdb6b1 _Block_release + 128
32 UIKit 0x000000010b568d9c -[_UIViewControllerTransitionContext .cxx_destruct] + 94
33 libobjc.A.dylib 0x000000010c02f7bb _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127
34 libobjc.A.dylib 0x000000010c03a390 objc_destructInstance + 93
35 libobjc.A.dylib 0x000000010c03a3c3 object_dispose + 22
36 UIKit 0x000000010b567825 -[_UIViewControllerTransitionContext dealloc] + 56
37 UIKit 0x000000010b568e51 -[_UIViewControllerOneToOneTransitionContext dealloc] + 79
38 libobjc.A.dylib 0x000000010c044afe _ZN11objc_object17sidetable_releaseEb + 232
39 MyApp 0x000000010d4818d2 block_destroy_helper + 66
40 MyApp 0x000000010d481988 _TPA__TFFC16MyApp31CustomShrinkAnimator17animateTransitionFS0_FPSo36UIViewControllerContextTransitioning_T_U0_FSbT_ + 152
41 MyApp 0x000000010d481a28 _TPA__TTRXFo_dSb_dT__XFo_iSb_iT__ + 120
42 MyApp 0x000000010d481aed block_destroy_helper8 + 13
43 libsystem_blocks.dylib 0x0000000110fdb6b1 _Block_release + 128
44 UIKit 0x000000010ac5ee47 -[UIViewAnimationBlockDelegate .cxx_destruct] + 43
45 libobjc.A.dylib 0x000000010c02f7bb _ZL27object_cxxDestructFromClassP11objc_objectP10objc_class + 127
46 libobjc.A.dylib 0x000000010c03a390 objc_destructInstance + 93
47 libobjc.A.dylib 0x000000010c03a3c3 object_dispose + 22
48 libobjc.A.dylib 0x000000010c044afe _ZN11objc_object17sidetable_releaseEb + 232
49 CoreFoundation 0x000000010a228d4d -[__NSDictionaryI dealloc] + 141
50 libobjc.A.dylib 0x000000010c044afe _ZN11objc_object17sidetable_releaseEb + 232
51 libobjc.A.dylib 0x000000010c0450b8 _ZN12_GLOBAL__N_119AutoreleasePoolPage3popEPv + 488
52 CoreFoundation 0x000000010a2129c6 _CFAutoreleasePoolPop + 22
53 CoreFoundation 0x000000010a246941 __CFRunLoopRun + 2081
54 CoreFoundation 0x000000010a245e98 CFRunLoopRunSpecific + 488
55 GraphicsServices 0x0000000112598ad2 GSEventRunModal + 161
56 UIKit 0x000000010abb8676 UIApplicationMain + 171
57 MyApp 0x00000001082b470d main + 109
58 libdyld.dylib 0x0000000110f9392d start + 1
59 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any pointers would be really appreciated.
This is expected behaviour.
Before you use any methods (like fetching, changing) of the Photos Framework, check the permission status to the Photo-Library. This is done by calling the authorizationStatus method of PHPhotoLibrary. If this method PHAuthorizationStatusNotDetermined,ask for permission using the requestAuthorization method. If authorizationStatushas a value of PHAuthorizationStatusDenied fall gracefully.
The main point is to let requestAuthorization prompt for access to the Photo-Library and not the fetch methods directly.
My crash situation is using PHCachingImageManager as a property.
fileprivate let imageManager = PHCachingImageManager()
I fix it by changing it to lazy var :
fileprivate lazy var imageManager = PHCachingImageManager()
I had the same experience. However, to reproduce it was not enough to exit the view controller and have it deallocated, but to Simulate Memory Warning in the simulator. This forced the crash.
So, my solution was to not use PHImageManager as a global variable, but to access it when need. Instead of this:
private let imageManager = PHImageManager.defaultManager()
...
imageManager.requestImageForAsset(....)
I did like this when needed:
PHImageManager.defaultManager().requestImageForAsset(....)
PHImageManager add a dispatch source event DISPATCH_SOURCE_TYPE_MEMORYPRESSURE when init.
When receive memory warning Photos framework will try to remove cached data in this event handler. At that time, if you have call but not get the authorization, it will cause crash
cause crash
For me it was crashing on 11 & 12 versions if user is not giving permissions to photos, but working fine on iOS 13. Below line was causing the issue.
fileprivate var imageManager = PHImageManager() // Crash
fileprivate lazy var imageManager = PHImageManager() // fixed the crash.

iOS: Bad access is cxx_descruct

I have a problem with an app crashing for a few users, I have no idea whats causing it and all I got is this stacktrace from crashlytics:
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x0000000194e5016c objc_release + 12
1 learnchinese 0x00000001000a95a0 -[WGRLanguageLabel .cxx_destruct] (WGRLanguageLabel.m:34)
2 libobjc.A.dylib 0x0000000194e36b1c object_cxxDestructFromClass(objc_object*, objc_class*) + 148
3 libobjc.A.dylib 0x0000000194e43f38 objc_destructInstance + 92
4 libobjc.A.dylib 0x0000000194e43f90 object_dispose + 28
5 UIKit 0x0000000187f8771c -[UIResponder dealloc] + 116
6 UIKit 0x0000000187c3dc38 -[UIView dealloc] + 1000
7 learnchinese 0x00000001000a5460 -[WGRLanguageLabel dealloc] (WGRLanguageLabel.m:39)
8 CoreFoundation 0x00000001830a10f8 CFRelease + 524
9 CoreFoundation 0x00000001830ad6b8 -[__NSArrayM dealloc] + 152
10 libobjc.A.dylib 0x0000000194e51724 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 564
11 CoreFoundation 0x00000001830a4d14 _CFAutoreleasePoolPop + 28
12 UIKit 0x0000000187c34584 _wrapRunLoopWithAutoreleasePoolHandler + 76
13 CoreFoundation 0x000000018317bff0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
14 CoreFoundation 0x0000000183178f7c __CFRunLoopDoObservers + 360
15 CoreFoundation 0x000000018317935c __CFRunLoopRun + 836
16 CoreFoundation 0x00000001830a4f74 CFRunLoopRunSpecific + 396
17 GraphicsServices 0x000000018cb076fc GSEventRunModal + 168
18 UIKit 0x0000000187ca6d94 UIApplicationMain + 1488
19 learnchinese 0x00000001001679ec main (main.m:13)
20 libdyld.dylib 0x00000001954e2a08 start + 4
It looks like WGRLanguageLabel has been released when auto release pool try to release it again.
Here is the dealloc method in WGRLanguageLabel:
#implementation WGRLanguageLabel
- (void)dealloc
{
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
...
#end

Resources