iphone - Refreshing the UITableView from UITableViewCell -
Is there an easy way to trigger [UITableView reloadData] from within a UITableViewCell? I'm loading remote images that appear after the initial table display, and updating the image with self.image = newImage
does not refresh the table by resetting the text value of the cell The table is fresh, but it looks muddy.
MyTableViewCell.h
@interface MyTableViewCell: UITableViewCell {} - (Zero) Image Byfered: (ImageData *) New Picture;
MyTableViewCell.m
@implementation MyTableViewCell - (Zero) Image Byfered: (UIImage *) newImageData {self.image = newImage; // does not refresh the table / wants to call [self.tableView reloadData] here, // but self.tableView does not exist / instead I use the bottom line self.text = self.text; // refresh table} @ and
I tried to do the exact thing you did . The thing you are looking for is needsLayout
for intelligence (this is a notification supervisor on my UitTable Weixel subclass):
- (zero) reload image : (NsNetification *) Notification {UIImage * image = [[SSI Image Manager Shared Image Manager] getImage: [[Information UserInfo] objectForKey: @ "imageUrl"]; [Self set image: image]; [Self setands layout]; }
This will pop your image without reloading the entire table, which can be very expensive.
Comments
Post a Comment