'An instance 0x155e74a0 of class UIWebView was deallocated while key value observers were still registered with it.
在iOS和html混编的时候,当用iOS原生的navigation导航pop回去的时候,出现
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x155e74a0 of class UIWebView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x156d3aa0> (
<NSKeyValueObservance 0x156d3a60: Observer: 0x156d12b0, Key path: estimatedProgress, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x15694bd0>
)'
解决方法:
在要pop回去的那个页面加如下代码,remove掉观察者
-(void)dealloc
{
[self.webView removeObserver:self forKeyPath:@"estimatedProgress"];
}
问题得以解决
'An instance 0x155e74a0 of class UIWebView was deallocated while key value observers were still registered with it.的更多相关文章
- xcode工程编译错误:"An instance 0xca90200 of class UITableView was deallocated while key value observers were still registered with it"
An instance 0xca90200 of class UITableView was deallocated while key value observers were still regi ...
- 旧Mj下拉刷新 An instance 0xca90200 of class UITableView was deallocated while key value observers were s
An instance 0xca90200 of class UITableView was deallocated while key value observers were still regi ...
- An instance 0x172b8600 of class UITableView was deallocated while key value
从带有tableview并且使用Mj下拉刷新的视图调用popViewControllerAnimated的时候,控制台打印这个: An instance 0x15d7aa00 of class UIT ...
- iOS 错误:… is being deallocated while key value observing are still registered with it
这个错误从字面上来看就是有一个实例由于被observing而无法被释放. 具体原因可能是该对象添加了一个oberver.所以释放的时候要先取消observer. 具体方法是在 dealloc 方法中: ...
- iOS从零开始学习直播之音频3.歌曲切换
上周迟到了,周末去参加OSC源创会了,还是有点启发的.但这不是重点,重点是 上一篇我只是实现了一首歌曲的在线播放,这肯定是不够的.这一篇博客主要是实现了多首歌曲的顺序播放以及上一首和下一首切换. ...
- KVO内部实现原理
KVO的原理: 只要给一个对象注册一个监听, 那么在运行时, 系统就会自动给该对象生成一个子类对象, (格式如:NSKVONotifying_className), 并且重写自动生成的子类对象的被监听 ...
- iOS开发——UI基础-KVO
KVO == Key Value Observing 作用: 可以监听某个对象属性的改变 一.使用KVO Person *p = [Person new]; p.name = @"chg&q ...
- iOS - KVO 键值观察
1.KVO KVO 是 Key-Value Observing 的简写,是键值观察的意思,属于 runtime 方法.Key Value Observing 顾名思义就是一种 observer 模式用 ...
- video 测试
https://segmentfault.com/a/1190000002401961 音量调节https://www.google.com/?gws_rd=ssl#newwindow=1& ...
随机推荐
- jsp请求java返回pdf、excel与word
1,返回pdf关键代码 /** * @todo * @param * @date 2019年3月8日 * @author yanan */ @RequestMapping("/getPdf& ...
- LAB6 SOAP
有web服务的,需要Deploy一下才能跑 通过ls看所有文件的所在地,cd进入对应文件夹,才可以编译 javac 编译,Java是执行 URL必须是WSDL文件点进去里面的:http://local ...
- OO第二单元学习总结
前言: 第二单元总共包括三次电梯调度作业.这三次作业在笔者看来是为了让学生了解什么是多线程,多线程的好处及可能存在的潜在问题,对于多线程的安全问题应该如何解决和保证结果的唯一性和正确性.那么接下来笔者 ...
- Struts2源码解析-----转载
前面一节描述的Struts2很多东西,这节是对源码进行分析描述,通过这一节应该对struts2有了清楚认识! 还是把Struts2这个框图贴出来: 第一步:HttpServletRequest进入到S ...
- 史上最全 | 39个RNAseq分析工具与对比
文献:Sahraeian S M E, Mohiyuddin M, Sebra R, et al. Gaining comprehensive biological insight into the ...
- 斗地主 ai的一些资料
zt https://programming.iteye.com/blog/1491470 https://blog.csdn.net/abc1234679/article/details/79458 ...
- UML中的六种关系
设计模式是一种对于面向对象语言(C#,C++,Java)的高级应用.其思维体现出的是真正的代码设计.每一种模式都堪称巧妙!但基于各种设计模式,这里少不了基本的类图设计,本文简要列出6种关系,及相关的例 ...
- join查询优化
更新使用过滤条件中包括自身的表 此方法不能无法在mysql中使用 `UPDATE user1 SET over='齐天大圣' WHERE user1.user_name IN ( SELECT b.u ...
- Educational Codeforces Round 36
A. Garden 题目链接:http://codeforces.com/contest/915/problem/A 题意:N个花洒,每个花洒浇花有一定的范围,现在有面积为K的花园,从N个花洒中选一个 ...
- linux_基本命令使用(后续更新)
安装文件上传下载快捷键 --> rz/sz yum -y install lrzsz 获取进程名.进程号以及用户ID netstat –nlpt 修改主机名(重启后永久生效)-->cent ...