I have a UITableViewController that shows a list of items from NSMutableArray, along with a button that serves as a check box that the user can select/deselect. I am able to su
Here i m Posting Another Answer so that it might help to others who wants to make this from Scratch and remove any Confusions.
Instead of Adding Button to tableViewCell
,you can use ImageView as AccessoryView.
UIImageView *imageView1 = [[[UIImageView alloc] init] autorelease];
imageView1.tag = indexpath.row;
[cell.accessoryView addSubview:imageView1];
And later get subview using -viewWithTag
: method:
UIImageView *getImageView1 = (UIImageView*)[cell.accessoryView viewWithTag:rowNumber];
getImageView1.image=[UIImage ImageNamed:@"checked.png"];
By the Above code we can change the image
of imageView
in selectRowAtindexPath
From my first Answer you can use the code to Select all or Multiple cell of tableView.