今天试了一个小demo,测出一个现象,同步出来:
object 作为 observer 监听了通知 A,然后 object 中途被释放执行了dealloc,随后app发出这个通知 A:

iOS 6、iOS 7、iOS 8: 必挂
iOS 9:不会挂

真机测试。

iOS 9.0 Documentation, 最新文档:
- addObserver:selector:name:object: 是说要添加remove observer的。


不知苹果后面 iOS9 小版本升级,会不会把这个改过来,现在这个现象和苹果的文档说法不一样。可能苹果在iOS9改了一个bug苹果内部自已防御了这个。

关于[[NSNotificationCenter defaultCenter] addObserver不remove后续又收到通知crash问题的更多相关文章

  1. ios NSNotificationCenter 收到通知后的执行线程

    https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Notifications/Articles/Thread ...

  2. 【翻译自mos文章】当/var/tmp文件夹被remove掉之后,GI crash,并启动失败,原因是ohasd can not create named pipe

    来源于: GI crashes and fails to start after "/var/tmp" directory was removed as ohasd can not ...

  3. NSNotification --关于通知

    一. 通知(NSNotification)的发送(Post)和注册(add)都必须借助于通知中心(NSNotificationCenter) 发送通知: NSNotificationCenter *c ...

  4. iOS 中的传值方式

    一. 属性传值   将A页面所拥有的信息通过属性传递到B页面使用 很常用的传值,也很方便,但是要拿到类的属性.例如: B页面定义了一个naviTitle属性,在A页面中直接通过属性赋值将A页面中的值传 ...

  5. iOS NSNotification通知

    通知中心(NSNotificationCenter) 通知(NSNotification) 一个完整的通知一般包含3个属性:(注意顺序) - (NSString *)name;  通知的名称 - (i ...

  6. ios 在ios9中 NSNotificationCenter addObserver 不会影响对象释放

    如题,ios9上,  [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(test) name:@&qu ...

  7. NSNotificationCenter带参

    (1)post Notification类 [[NSNotificationCenter defaultCenter] postNotificationName:CRMPerformanceNewCe ...

  8. NSNotificationCenter 使用姿势详解

    来源:JamesYu 链接:http://www.jianshu.com/p/a4d519e4e0d5 最近在做平板的过程中,发现了一些很不规范的代码.偶然修复支付bug的时候,看到其他项目代码,使用 ...

  9. NSNotificationCenter基础知识

    NSNotificationCenter基础知识   Notification的工作机制 1.对应用程序中其他地方发生的事件(比如增加一条数据库记录)感兴趣的对象,会向通告中心(Notificatio ...

随机推荐

  1. [LeetCode] Count Binary Substrings 统计二进制子字符串

    Give a string s, count the number of non-empty (contiguous) substrings that have the same number of ...

  2. [LeetCode] Maximum Binary Tree 最大二叉树

    Given an integer array with no duplicates. A maximum tree building on this array is defined as follo ...

  3. Python网络爬虫笔记(二):链接爬虫和下载限速

    (一)代码1(link_crawler()和get_links()实现链接爬虫) import urllib.request as ure import re import urllib.parse ...

  4. 用js来实现那些数据结构07(链表01-链表的实现)

    前面讲解了数组,栈和队列.其实大家回想一下.它们有很多相似的地方.甚至栈和队列这两种数据结构在js中的实现方式也都是基于数组.无论增删的方式.遵循的原则如何,它们都是有序集合的列表.在js中,我们新建 ...

  5. DDCTF 2018线上赛writeup

    第一题: d4e8e1f4a0f7e1f3a0e6e1f3f4a1a0d4e8e5a0e6ece1e7a0e9f3baa0c4c4c3d4c6fbb9b2b2e1e2b9b9b7b4e1b4b7e3e ...

  6. codevs 3061 质子撞击炮②

    提交地址:http://codevs.cn/problem/3016/ 3016 质子撞击炮 II  时间限制: 1 s  空间限制: 32000 KB  题目等级 : 黄金 Gold     题目描 ...

  7. [HAOI2016]找相同字符

    题目描述 给定两个字符串,求出在两个字符串中各取出一个子串使得这两个子串相同的方案数.两个方案不同当且仅当这两个子串中有一个位置不同. 输入输出格式 输入格式: 两行,两个字符串s1,s2,长度分别为 ...

  8. codeforces 868A Bark to Unlock

    As technologies develop, manufacturers are making the process of unlocking a phone as user-friendly ...

  9. [Tjoi2013]最长上升子序列

    Description 给定一个序列,初始为空.现在我们将1到N的数字插入到序列中,每次将一个数字插入到一个特定的位置.每插入一个数字,我们都想知道此时最长上升子序列长度是多少? Input 第一行一 ...

  10. [UOJ] #217. 【UNR #1】奇怪的线段树

    题解见大佬博客 我的丑陋代码: #include<cstdio> #include<cstring> #include<cstdlib> inline int re ...