Note that there are some explanatory texts on larger screens.

plurals
  1. POUITableView is slow
    primarykey
    data
    text
    <p>I have a <code>view</code> which I dragged a <code>UITableView</code> in it, and 2 <code>UIImageView</code>s (the 1st one to show a background image and the second one is just showing a very small title at the top of the view with an image). They're all set to <code>weak</code> properties. The tableView has 495 rows and an image loads into each cell. Here's the code for configuring a cell:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } int cellNumber = indexPath.row + 1; NSString *cellImage1 = [NSString stringWithFormat:@"c%i.png", cellNumber]; UIImage *theImage = [UIImage imageNamed:cellImage1]; [cell.imageView setImage:theImage]; UIView *bgColorView = [[UIView alloc] init]; [bgColorView setBackgroundColor:[UIColor brownColor]]; [cell setSelectedBackgroundView:bgColorView]; return cell; } </code></pre> <p>I use <code>segue</code>s, so I don't need the delegate method. (which not relevant to this question either). The thing is, the scrolling is smooth; BUT if I scroll <em>TOO FAST</em> then it gets slow and probably causes the app to crash. The png images loaded into cells are not big sizes, each one is around 5KB. It seems the the dequeueing job is not done efficiently; cuz it gets slow, shows a memory warning message and then the crash happens. Anything I can do about it? (there's nothing else in the view) </p> <p>UPDATE: I've also tried removing this part of code:</p> <pre><code>UIView *bgColorView = [[UIView alloc] init]; [bgColorView setBackgroundColor:[UIColor brownColor]]; [cell setSelectedBackgroundView:bgColorView]; </code></pre> <p>no use!</p>
    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