OC提供的bolock遍历方法

来源:互联网 发布:lua nginx module安装 编辑:程序博客网 时间:2024/06/05 17:19
//改变数组中赞data    NSString *userName = [GLUserDataManager sharedInstance].user_info.name;    NSInteger userID = [GLUserDataManager sharedInstance].user_id;    NSString *tempGoodStr = [NSString stringWithFormat:@"%@|#|%ld",userName,(long)userID];        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{        [messageList enumerateObjectsWithOptions:NSEnumerationConcurrent usingBlock:^(id obj, NSUInteger idx, BOOL *stop) {            GLMessageData *tempMessageData = (GLMessageData *)obj;            if (tempMessageData.messageID == _messageID) {                if (tempMessageData.good.length == 0) {                    tempMessageData.good = [NSString stringWithFormat:@"%@",tempGoodStr];                }else{                    tempMessageData.good = [NSString stringWithFormat:@"%@|,|%@",tempMessageData.good,tempGoodStr];                }                *stop = YES;            }                    }];        dispatch_async(dispatch_get_main_queue(), ^{            [chatTableView reloadData];        });    });

0 0
原创粉丝点击