dispatch_queue_t dispatchQueue = dispatch_queue_create("ted.queue.next",DISPATCH_QUEUE_CONCURRENT);
dispatch_group_t dispatchGroup = dispatch_group_create();
dispatch_group_async(dispatchGroup, dispatchQueue, ^(){
for (NSInteger i = 0; i < self.messageArray.count; i ++) {
totalHeight = totalHeight + [self getCellHeight:self.messageArray[i] WithIsLastRow:self.messageArray.count - 1 == i WithIndexRow:i];
}
});
dispatch_group_notify(dispatchGroup,dispatch_get_main_queue(), ^(){
if (totalHeight > self.table.height) {
CGPoint offset = CGPointMake(0,ceil(totalHeight) - ceil(self.table.height) );
[self.table setContentOffset:offset animated:NO];
}
[self.table reloadData];
});
dispatch_group_t dispatchGroup = dispatch_group_create();
dispatch_group_async(dispatchGroup, dispatchQueue, ^(){
for (NSInteger i = 0; i < self.messageArray.count; i ++) {
totalHeight = totalHeight + [self getCellHeight:self.messageArray[i] WithIsLastRow:self.messageArray.count - 1 == i WithIndexRow:i];
}
});
dispatch_group_notify(dispatchGroup,dispatch_get_main_queue(), ^(){
if (totalHeight > self.table.height) {
CGPoint offset = CGPointMake(0,ceil(totalHeight) - ceil(self.table.height) );
[self.table setContentOffset:offset animated:NO];
}
[self.table reloadData];
});