Note that there are some explanatory texts on larger screens.

plurals
  1. POUse a custom UITableViewCell for many UITableView
    primarykey
    data
    text
    <p>I have created a custom <code>UITableViewCell</code> for a <code>UITableView</code> by dragging and dropping the labels and <code>imageView</code> from my Prototype Cell to a Custom Cell which I call QuizInfoCell.</p> <p>That works fine for the particular <code>TableView</code> that I created the Prototype Cell in, but I can't get <code>QuizInfoCell</code> to work for any other <code>TableView.</code> How can I achieve that?</p> <p>This is the code that I'm using in the <code>TableView</code> that created the Prototype Cell:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ QuizInfoCell *cell = nil; cell = [tableView dequeueReusableCellWithIdentifier:@"QuizInfoCell" forIndexPath:indexPath]; if (cell == nil){ cell = [[QuizInfoCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"QuizInfoCell"]; } cell.name.text = [title objectAtIndex:indexPath.row]; cell.author.text = [author objectAtIndex:indexPath.row]; cell.time.text = [[ValueHandler alloc] getDateString:[timeStamp objectAtIndex:indexPath.row]]; cell.plays.text = [@"Plays: " stringByAppendingString:[NSString stringWithFormat:@"%@", [plays objectAtIndex:indexPath.row ]]]; cell.ratingUps.text = [NSString stringWithFormat:@"%@", [ratingUps objectAtIndex:indexPath.row]]; cell.ratingDowns.text = [NSString stringWithFormat:@"%@", [ratingDowns objectAtIndex:indexPath.row]]; cell.qid.text = [NSString stringWithFormat:@"%@", [qid objectAtIndex:indexPath.row]]; return cell; } </code></pre>
    singulars
    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