I am manually creating a tableViewCell (which is custom) by specifying an indexPath. For some reason, sometimes the cell will receive the cell object and sometimes it will not contain an object. I know a cell exists at the indexPath specified, but more some reason the code sometimes can’t get the object from it. Any ideas?
-(BOOL)checkRequiredValues {
NSIndexPath *cellIndexPath;
CheckoutCell *cell;
cellIndexPath = [NSIndexPath indexPathForRow:1 inSection:0];
cell = (CheckoutCell *)[self.tableView cellForRowAtIndexPath:cellIndexPath];
}
The
cellForRowAtIndexPath:onUITableViewreturnsnilif the cell is not visible:If you would like to get a cell all the time, call the same method on your data source: