I am writing to learn more about possible reasons why a cell, containing an image, within a UITableView does not refresh after call to reloadData; rest of row, which contain labels, updates with new data after call to reloadData;
Working with a UIPickerView containing two options - default data of UITableView is first option of UIPickerView; if second option of UIPickerView is selected, each row updates, refreshes OK;
However, column containing images does not update, refresh - and images remain from initial loading of data; working in debug mode of Objective-C, inside of method cellForRowAtIndexPath - image URLs, to be assigned to cells of UITableView, are available and returned from array;
Working with a UIPickerView containing two options - default data of UITableView is first option of UIPickerView; if second option of UIPickerView is selected, each row updates, refreshes OK;
However, column containing images does not update, refresh - and images remain from initial loading of data; working in debug mode of Objective-C, inside of method cellForRowAtIndexPath - image URLs, to be assigned to cells of UITableView, are available and returned from array;
Issue was related to cache of images; below method resolves issue of loading previous, cached images;
Converting image URLs to images in application slows down process of scrolling thru damage items of UI Table View:
However - now images are available for each condition report;
NSURL *damageImage;
damageImage = saveImageDI;
NSData *data = [NSData dataWithContentsOfURL:damageImage];
UIImage *image = [UIImage imageWithData:data];
if (image) {
[self setImage:image];
[self alertFinishedLoadingImage:image];
return;
}
}
Converting image URLs to images in application slows down process of scrolling thru damage items of UI Table View:
However - now images are available for each condition report;
(void)loadDamageItemImage:(NSString *)vin imageURL:(NSURL *)url
NSURL *damageImage;
damageImage = saveImageDI;
NSData *data = [NSData dataWithContentsOfURL:damageImage];
UIImage *image = [UIImage imageWithData:data];
if (image) {
[self setImage:image];
[self alertFinishedLoadingImage:image];
return;
}
}