I am creating an application where the user can select multiple cells from a table, and each time a cell is selected, it is being added to an NSMutableArray. The table contains names of different countries. Once all the countries are selected, how do I search for which countries are selected? For example, how do I check if the user selected United States for example?
I have this in my didSelectRow for my table:
if ([selectedCell accessoryType] == UITableViewCellAccessoryNone) {
[selectedCell setAccessoryType:UITableViewCellAccessoryCheckmark];
[listofCountriesselected addObject:[NSNumber numberWithInt:indexPath.row]];
}
else {
[selectedCell setAccessoryType:UITableViewCellAccessoryNone];
[listofCountriesselected removeObject:[NSNumber numberWithInt:indexPath.row]];
}