I do not use UIImageView+AFNetworking.h , but the idea of ββcalculating the line height is to calculate the image height after loading some where
hope this method helps you
- (void)setImageWithURLRequest:(NSURLRequest *)urlRequest placeholderImage:(UIImage *)placeholderImage success:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image))success failure:(void (^)(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error))failure;
and after loading the image in success calculate the height of the image image.size.height and add this to the array for the table
NSMutableDictionary *record = [array objectAtIndex:index]; [record setObject:[NSString stringWithFormat:@"%f",image.size.height] forKey:@"imageheight"]; [array replaceObjectAtIndex:index withObject:record]; [tableView reloadData];
and set a line height similar to this
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { NSMutableDictionary *record = [array objectAtIndex:index]; if ( [record objectForkey:@"imageheight"] ) { return [[record objectForkey:@"imageheight"] floatValue] + yourmargin);
source share