美文网首页
[__NSArrayM objectAtIndex:]: ind

[__NSArrayM objectAtIndex:]: ind

作者: 陆壹吱吱 | 来源:发表于2018-07-11 09:58 被阅读14次

_observer = [[NSNotificationCenter defaultCenter] addObserverForName:YZUpdateMenuTitleNote object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification * _Nonnull note) {

NSInteger col = [self.controllers indexOfObject:note.object];

if(col != NSNotFound) // <-

        {

// 获取对应按钮

UIButton *btn = self.menuButtons[col];

// 隐藏下拉菜单

 [self dismiss];

// 获取所有值

NSArray *allValues = note.userInfo.allValues;

// 不需要设置标题,字典个数大于1,或者有数组

if (allValues.count > 1 || [allValues.firstObject isKindOfClass:[NSArray class]]) return ;

// 设置按钮标题

 [btn setTitle:allValues.firstObject forState:UIControlStateNormal];

        }

相关文章

网友评论

      本文标题:[__NSArrayM objectAtIndex:]: ind

      本文链接:https://www.haomeiwen.com/subject/cxgcpftx.html