'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& ...
随机推荐
- Python2和3版本对str和bytes类型的处理
python2中字符串分为2种类型: 字节类型:str,字节类型,通过decode()转化为unicode类型 unicode类型:unicode ,通过encode转化为str字节类型 字节类型 和 ...
- jq实现前端文件上传
FormData FormData是XMLHttpRequest Level 2 新增的一个接口. 使用FormData可以实现各种文件上传. 使用 // 创建FormData的实例 var form ...
- linux回顾
linux内容回顾: centos6.9 ubuntu12 麒麟linux suse(德国linux) depin xshell(连接工具) vmware workstation(个人学习) ...
- python websocket 客户端连接
# -*- coding: utf-8 -*-import jsonimport websocketimport _thread as thread # try:# import thread# ex ...
- 对DOM,SAX,JDOM,DOM4J四种方法解析XML文件的分析
1.DOM 与平台无关的官方解析方式 DOM是一次性把xml文件加载到内存中,形成一个节点树 对内存有要求 2.SAX java提供的基于事件驱动的解析方式 每次遇到一个标签,会触发相应的事件方法 3 ...
- Sketch 画原型比 Axure 好用吗?为什么?
对工具而言,个人觉得没有说哪个工具好用不好用之分,更重要一点,做设计的来讲什么时候用什么工具来提高工作效率,这个最重要.下面我也来讲讲这二款工具的不同之处: Axure算是原型工具里的 Old Sch ...
- 1. String可调用方法
class str(basestring): """ str(object='') -> string Return a nice string represent ...
- this()基础用法
this()表示调用构造方法,此种调用只能用在构造方法中,即构造方法中调用构造方法this(实参). 1.this().this(实参)必须方法构造方法的第一行 2.在有参数构造方法中调用无参数构造方 ...
- 二、PyQt5基本功能和操作入门
在这里,我将根据自己的学习历程从初级到高级介绍pyqt5.因为是学到哪里就写道哪里,所以内容排版比较随意.有两点问题需要先说明: 1.虽然界面的设计可以借助qt designer进行拖拽创建,并且可以 ...
- Qt自定义滚动条(不使用样式表)
前面使用Qt 样式表实现滚动条,在实际工作中,发现存在一些瑕疵,例如如果在主窗口中绘制背景,则有可能给滚动条染色,还有如果想实现特殊的效果,则必须使用自定义风格,即从QStyle的子类派生出新的类型. ...