zoukankan      html  css  js  c++  java
  • iOS 环信透传cmd消息多次重复接收,解决办法

    由于项目需求,需要在项目中接到消息的时候做不同界面的不同的操作,哪儿需要哪儿就要添加代理;引起代理事件重复执行;所以要在VC显示的时候添加代理,消失的时候删除代理

    环信 透传 消息多次接收情况(由于代理多次添加,没有取消掉)

    在VC将要显示和 消失中 挂代理,删除代理

    -(void)viewWillAppear:(BOOL)animated{}

    -(void)viewWillDisappear:(BOOL)animated{}

     

    #pragma mark - registerNotifications

    -(void)registerNotifications{

        [self unregisterNotifications];

        [[EMClient sharedClient].chatManager addDelegate:self delegateQueue:nil];

        [[EMClient sharedClient].groupManager addDelegate:self delegateQueue:nil];

    }

    -(void)unregisterNotifications{

        [[EMClient sharedClient].chatManager removeDelegate:self];

        [[EMClient sharedClient].groupManager removeDelegate:self];

    }

  • 相关阅读:
    002.NFS相关配置项
    001.NFS简介
    002.DNS-BIND简介
    001.DNS原理及配置格式
    002.DHCP配置
    001.DHCP简介
    001.Chrony时间服务器
    博客开篇记载!
    【python-opencv】图像梯度
    【python-opencv】形态转换
  • 原文地址:https://www.cnblogs.com/xujiahui/p/7155681.html
Copyright © 2011-2022 走看看