首页 > 移动平台 > 详细

IOS 消息

时间:2015-07-17 18:38:19      阅读:117      评论:0      收藏:0      [点我收藏+]

发送消息:

 

 NSDictionary *dict=[[NSDictionary alloc]initWithObjectsAndKeys:@"num",[NSString stringWithFormat:@"%d",person.i_Msg], nil];
 
[[NSNotificationCenter defaultCenter] postNotificationName:@"hideTabBar" object:self userInfo:dict];

 

接收消息:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(hideTabBar:) name:@"hideTabBar" object:nil];

 

-(void)hideTabBar:(id)sender
{
    NSString *num=[[sender userInfo] objectForKey:@"num"];
    _numOfmsg = _numOfmsg-[num intValue];
      [self.tabBar showBadgeOnItemIndex:3 andNumber:_numOfmsg];
    if (_numOfmsg==0) {
          [self.tabBar hideBadgeOnItemIndex:3];
    }
  
    
    
}

 

IOS 消息

原文:http://www.cnblogs.com/SimonGao/p/4655120.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!