If I have a UITableView that has 4 rows in it then shouldn\'t the cellForRowAtIndexPath method be called 4 times when I navigate to that view? I am finding that it is being
Highly probable that you are calling from other methods :
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
self.tableView from outside of - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
will call cellForRowAtIndexPath twice.
The method is called when the cell appears, so whenever a cell appears, the method is called. Also, the cells are reused. So even if the method for a particular cell is called once, it maybe called for another time when this cell disappears and then appears again.
Swift
DispatchQueue.main.async {
//Add selection in main queue
}
This will fix the issue.