Reputation: 57
I am using an UITableView with checkmarks and I want to set a label count which shows how many items are checkmarked in the table view. For example if the table contains 18 items with 2 checks,it shows 2/18. Can any one help me to code?
Upvotes: 0
Views: 254
Reputation: 130212
Assuming that this means that these cells will be selected, you could try this:
NSArray *array = [[NSArray alloc] initWithArray:tableView.indexPathsForSelectedRows];
myCount = [array count];
alternatively, you could keep a running tally of an integer and add to it or subtract from it every time a cell is selected or deselected.
Upvotes: 1