[UIActivityIndicatorView _applicationDidEnterBackground:]: message sent to deallocated instance
来源:互联网 发布:se壳网络验证 编辑:程序博客网 时间:2024/05/29 18:27
[UIActivityIndicatorView _applicationDidEnterBackground:]: message sent to deallocated instance
当我们运行我的的App 时,App不会crash,可当我们一按home 键,或者锁屏时,App 就会 crash ,利用zombie 可以捕获如上信息。由信息中可得,app 向一个已经被释放的UIActivityIndicatorView发送了一个消息,导致crash。最后检查到原来是是使用的第三方包UIKit+AFNetWorking 导致的,
再 UIActivityIndicatorView+AFNetworking.m 中,有如下代码,
-(void)dealloc
{
NSNotificationCenter *notificationCenter = [NSNotificationCenterdefaultCenter];
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000
[notificationCenter removeObserver:selfname:AFNetworkingTaskDidCompleteNotificationobject:nil];
[notificationCenter removeObserver:selfname:AFNetworkingTaskDidResumeNotificationobject:nil];
[notificationCenter removeObserver:selfname:AFNetworkingTaskDidSuspendNotificationobject:nil];
#endif
[notificationCenter removeObserver:selfname:AFNetworkingOperationDidStartNotificationobject:nil];
[notificationCenter removeObserver:selfname:AFNetworkingOperationDidFinishNotificationobject:nil];
}
那就很明显了,当App 进入后台,UIActivityIndicatorView 被释放,当执行这个方法,App 便被crash了。
如果大家引入UIKit+AFNetWorking 时,没有用到UIActivityIndicatorView+AFNetworking ,大可把他移除掉,这样就可以解决上面的问题了。
希望对大家有帮助。
http://blog.csdn.net/scyatcs/article/details/38108683
- [UIActivityIndicatorView _applicationDidEnterBackground:]: message sent to deallocated instance
- [UIActivityIndicatorView _applicationDidEnterBackground:]: message sent to deallocated instance 0x48
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- message sent to deallocated instance
- [UIImage _isCached]: message sent to deallocated instance
- message sent to deallocated instance 除錯
- message sent to deallocated instance 除錯
- “[CALayer release]: message sent to deallocated instance
- How to disable Grub's menu from showing up after failed boot
- 判断IP地址的合法性
- 树形结构的处理——组合模式
- NFinal 视图—用户控件
- html中的表单元素总结
- [UIActivityIndicatorView _applicationDidEnterBackground:]: message sent to deallocated instance
- Decision Tree 决策树 - ID3, C45, C50, CART...
- c程序调用 mysql库函数 操作数据库
- 图像的特征提取都有哪些算法
- socket+Protocol buffer 错误
- iOS开发-多线程编程
- applet使用实践
- 关于git sourcetree 使用的问题(无法提交)
- java 软件 设置session超时(失效)的三种方式