Why does this code return a cell?
static NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
But when I am trying to get cell with
[tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]
it does not return anything. Does anybody know how it is possible?
According to Apple’s documentation:
So if that cell is not currently visible then it will return
nil. So, is it visible?Other than that – check that you are actually creating cells in
cellForRowAtIndexPath:as you haven’t specifically shown that you are.