I have found this code for a custom UITableViewCell :
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray* views = [[NSBundle mainBundle] loadNibNamed:@"MyCustomCell" owner:nil options:nil];
MyCustomCell *customCell = [[MyCustomCell alloc]init];
MyCustomCell.cellImage = [arrayImages objectAtIndex:indexPath.row];
for (UIView *view in views)
{
if([view isKindOfClass:[UITableViewCell class]])
{
cell = (MyCustomCell *)view;
}
}
}
and I could not figure how this specific part works: cell = (MyCustomCell *)view;
I wanted to change it for my previously created instance of MyCustomCell (customCell)… How could I do that?
Sometimes people will create a custom
UITableViewCellusing Interface Builder. This person is just loading their customUITableViewCellsubclass and assigning it to the cell. The line:cell = (MyCustomCell *)view;presumable works becauseMyCustomCellis a subclass ofUITableViewCell.This is just another technique for creating custom cells sometimes you’ll see a similar thing done with tags.