添加对 kJPFNetworkDidCloseNotification 的监听

ios
标签: #<Tag:0x00007fb83285d468>

(老宁哥) #1

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(JPushMes:) name:@“kJPFNetworkIsConnectingNotification” object:nil];//极光正在连接
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(JPushMes:) name:@“kJPFNetworkDidRegisterNotification” object:nil];//注册成功
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(JPushMes:) name:@“kJPFNetworkDidSetupNotification” object:nil];//极光建立连接
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(JPushMes:) name:@“kJPFNetworkDidCloseNotification” object:nil];//极光连接断开

添加监听之后,我关闭手机网络,会出现
| JIGUANG | W - [JIGUANGNetworkController] 网络发生变化,重启session

但是我添加的监听方法没有走,是不是我添加的监听不对?
kJPFNetworkIsConnectingNotification kJPFNetworkDidRegisterNotification 这两个的监听可以调用相应的方法,其它的都没有走,是不是我添加的方法对?


(12) #2

image

这个是直接用,为什么你要套一个字符串的标识呢~

image


(老宁哥) #3

:joy: 原谅我比较菜。。。