[UIKeyboardLayoutStar release] && [UIKeyboardTaskEntry dealloc]
来源:互联网 发布:mac pro 支持pcie ssd 编辑:程序博客网 时间:2024/06/06 01:23
这篇文章是近期解过的一个bug,由于我的日志是在Crashlytics上拿到的,很有迷惑性,此次写下来希望对遇到这种错误的小伙伴有帮助。
1.先上崩溃日志:
#0. Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x18da99704 objc_object::release() + 8
1 libsystem_blocks.dylib 0x18df27a28 _Block_release + 144
2 UIKit 0x19597ab48 -[UIKeyboardTaskEntry dealloc] + 68
3 libobjc.A.dylib 0x18da99fe0 (anonymous namespace)::AutoreleasePoolPage::pop(void*) + 704
4 CoreFoundation 0x18ef22028 _CFAutoreleasePoolPop + 28
5 UIKit 0x195181ae8 _prepareForCAFlush + 596
6 UIKit 0x194ef113c _afterCACommitHandler + 304
7 CoreFoundation 0x18eff60c0 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
8 CoreFoundation 0x18eff3cf0 __CFRunLoopDoObservers + 372
9 CoreFoundation 0x18eff4180 __CFRunLoopRun + 1024
10 CoreFoundation 0x18ef222b8 CFRunLoopRunSpecific + 444
11 GraphicsServices 0x1909d6198 GSEventRunModal + 180
12 UIKit 0x194f697fc -[UIApplication _run] + 684
13 UIKit 0x194f64534 UIApplicationMain + 208
14 xxxxxxxx 0x10012e304 main (main.m:14)
15 libdispatch.dylib 0x18df055b8 (Missing)
这段日志看似是崩溃在系统里面,是像一个已经release的对象发送了消息,经过多方搜索,终于找的了这个问题的原因。是因为我用method swizzle 将NSArray和NSMutableArray的objectAtIndex:方法用自己的方法替换掉了。这个bug的复现方法是找到一个可以显示keyboard的页面,然后按home键退到后台,然后这个bug就会复现了。前提你的Xcode的Zombie Objects是开着的。这个bug的解决办法就是恢复到系统原油的objectAtIndex:就好了。至于为什么会出这个错误,我想是因为在objectAtIndex:实现了并不是简单的获取object的操作才导致了这个崩溃的出现。
参考文档:
http://www.cnblogs.com/DamonTang/p/4342366.html
http://blog.csdn.net/alincexiaohao/article/details/45913857
- [UIKeyboardLayoutStar release] && [UIKeyboardTaskEntry dealloc]
- iOS [UIKeyboardLayoutStar release]
- dealloc & release
- iOS [UIKeyboardLayoutStar release]: message sent to deallocated
- UIKeyboardLayoutStar release] message sent to deallocated instance
- release VS dealloc
- dealloc方法与release
- dealloc和release的关系
- 为什么不能直接调用dealloc而是release
- Iphone开发(5) retain,release,retainCount,dealloc
- Implementing alloc, retain, release, and dealloc
- 深入解析alloc/retain/release/dealloc实现
- dealloc函数中变量的release
- dealloc
- dealloc
- dealloc
- Difference between release and dealloc in objective-c
- Set to nil in viewDidUnload, but release in dealloc
- CAM350 导出SMT坐标文件
- Kmeans算法详解及MATLAB、Python实现
- 八大排序
- 音视频数据处理(17)--- H.264的NAL层数据单元NALU
- JAVA虚拟机规范读书笔记--class文件结构及数据类型
- [UIKeyboardLayoutStar release] && [UIKeyboardTaskEntry dealloc]
- java中main函数解析
- Java线程Executor框架详解与使用
- window对象(二)
- 求无序数组中三元素相加等于特定值的所有情况
- MyBatis 延迟加载,一级缓存,二级缓存设置
- Linux命令之五--tar
- 编译原理实验六—代码优化
- AT89C51小白的LTC1549 A/D转换器 电压表