Setting an image in a UIImageView inside a table view cell?

As long as you keep a reference to the cell, it's not too hard. I'd go about it like this.

As long as you keep a reference to the cell, it's not too hard. I'd go about it like this: - (void)downloadDone:(UIImage*)img { NSIndexPath *indexPath = NSIndexPath indexPathForRow:yourCellRow inSection:yourCellSection; UITableViewCell *cell = myTableView cellForRowAtIndexPath:indexPath; // now you have the cell you wish to modify; cell.myimageView. Image=img; myTableView reloadData; // if you would prefer, you could also call myTableView reloadRowsAtIndexPaths:NSArray arrayWithObject:indexPath withRowAnimation:UITableViewRowAnimationNone // if you only want to reload that specific cell; }.

Not Working this code plz help – user763657 May 25 at 9:29 I just tested this and it worked fine for me. I used cell.imageView. Image = UIImage imageNamed:@"testImage.

Png";, but it is the same idea. Try setting up a log statement when downloadDone that says something like NSLog(@"image is %@", img); to make sure the image exists. My guess is that the image either doesn't exist or is getting released before you can set it (which we can fix later after we figure out what is going wrong) – slev May 25 at 18:08.

Even if you are able to set it in the downloadDone: method, you will face a problem later because of reusable cells. So the right place for setting the image would be the tableView:cellForRowAtIndexPath: itself. So how do you load the images?

Save them in an array or a dictionary. Say the count doesn't change, we can use an NSMutableArray object to store count number of NSNull singleton objects and later, in tableView:cellForRowAtIndexPath: if ( images objectAtIndex:indexPath. Row isMemberOfClass:UIImage class ) { cell.myImageView.

Image = images objectAtIndex:indexPath. Row; } in LoadImage for(int x=0;x.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions