//改变数组中赞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];
});
});
OC提供的bolock遍历方法
最新推荐文章于 2016-09-06 16:05:24 发布