Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS TableView Cells
    primarykey
    data
    text
    <p>I have found many answers to problems I've encountered on here and would like to ask a question for the first time (I'm a newbie to asking for help!)</p> <p>I've implemented the <code>SDWebImage</code> framework into an project that uses <code>JSON</code> parsed data to populate a <code>UITableViewController</code>. The images are being cached successfully but when the App first launches, all the cell images are absent. Only when I scroll up or down and the rows appear (or when I tap them to select a row) do they appear. If I go back into it, all the images are there cached and work fine. It's just the first launch that I am missing all my images. I've pasted what I have here in the hope someone can post a simple solution. Got a feeling it's something minor that I have to do to make them appear on first launch.</p> <p>Code follows:</p> <pre><code>static NSString *MyIdentifier = @"Maincell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:MyIdentifier]; } UIFont *wireBold = [UIFont fontWithName:@"Helvetica" size:14.0f]; cell.textLabel.text = [[news objectAtIndex:indexPath.row]objectForKey:@"Title"]; cell.textLabel.font = wireBold; cell.textLabel.textColor = [UIColor blackColor]; UIFont *wireSub = [UIFont fontWithName:@"Sintony" size:10.0f]; cell.detailTextLabel.text = [[news objectAtIndex:indexPath.row]objectForKey:@"Name"]; cell.detailTextLabel.font = wireSub; cell.detailTextLabel.textColor = [UIColor grayColor]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; NSString *filePath = [[news objectAtIndex:indexPath.row]objectForKey:@"Image"]; NSString *urlString = [NSString stringWithFormat:@"http://www.mywebhost/images/%@.png",filePath]; [cell.imageView setImageWithURL:[NSURL URLWithString:urlString] placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; 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.
    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