I have a table view and i want to have a different image on each cell depending what button was pressed. I Want the app to be like the amazon application on ipad/iPhone. I want the image of the product to be in the cell, depending on what button was pressed. The buttons are on a seperate page also. The code i have so far is this:
Code:
- (IBAction)outlet1:(id)sender {
[cart.cells addObject:@"1"];
cart.cell.imageView.image = [UIImage imageNamed:@"paddle1.png"];
}
- (IBAction)outlet2:(id)sender {
//Cart is just referring to a different flie. (im not sure how to use the correct terminology.)
[cart.cells addObject:@"1"];
cart.cell.imageView.image = [UIImage imageNamed:@"paddle2.png"];
}
This button adds the cell correctly, but doesnt add the image. I also call:
[myTableView reloadData];
in the viewDidLoad method.
Please help! ive been stuck on this for about a week and no one will seem to help! Thanks in advance!!