Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to show different custom cell in a table view in ios
    primarykey
    data
    text
    <p><strong>1. in my method in write code example given below -</strong> </p> <pre><code> (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *simpleTableIdentifier = @"SimpleTableCell"; static NSString *simpleTableIdentifier2 = @"SimpleTableCell2"; if (indexPath.row== 0) { SimpleTableCell *cell = nil; cell=(SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; } if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil]; cell = [nib objectAtIndex:0]; } if (indexPath.row == 1) { SimpleTableCell2 *cell2 = nil; cell2=(SimpleTableCell2 *) [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier2]; } if (cell2 == nil) { NSArray *nib2 = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell2" owner:self options:nil]; cell2 = [nib2 objectAtIndex:0]; } cell.nameLabel.text = [tableData objectAtIndex:indexPath.row]; cell.thumbnailImageView.image = [UIImage imageNamed:[thumbnails objectAtIndex:indexPath.row]]; cell.prepTimeLabel.text = @"detail";// [prepTime objectAtIndex:indexPath.row]; //cell.imageView.image = [UIImage imageNamed:@"creme_brelee.jpg"]; cell2.nameLabel.text = [tableData objectAtIndex:indexPath.row]; return cell; } </code></pre> <p>can any one help me am i write correct code becoz it will give an error the error is use of undeclear identifier cell and cell2 i dont understand what is this error it gives the error after making cell2 before cell2 it works perfectly help me thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload