I am using a custom UITableViewCell in my UITableView but the problem is that the cell is never nil when calling the dequeueReusableCellWithIdentifier. Why is this ?
As others have pointed out if you have registerd a nib to reuse a tableViewCell you are guaranteed to get an instance of cell. If you want to set some value to the cell. You can try modifying your code like this
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath{
PHResultTableViewCell *cell = (PHResultTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"MyCell"
forIndexPath:indexPath];];
cell.packageHolidayItem = totalArray[indexPath.row];;
[cell loadRow];
return cell;
}