ios 关于tabbar显示badge的问题

 注意的是根据通知刷新tabbar上面的badge的时候,一定是要在主线程,代码一定要放在主线程

dispatch_async(dispatch_get_main_queue(), ^{

        

        [self.tabBar.items[2] setBadgeValue:[notification.userInfo valueForKey:@"count"]];

        

    });

posted @ 2018-06-06 16:56  我愿是激流  阅读(303)  评论(0)    收藏  举报