Note that there are some explanatory texts on larger screens.

plurals
  1. POiPhone UITableViewCell slow performance
    text
    copied!<p>I just wrote a small application that read from a site feed and display in UITableViewCell. I am using custom view cell and my UITableView is screwed in scrolling like it is not very smooth in scrolling upside down. Any idea? Here's the code for my UITableViewCell,</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"CustomCell"; CustomCell *cell = (CustomCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { // cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:nil options:nil]; for(id currentObject in topLevelObjects) { if([currentObject isKindOfClass:[UITableViewCell class]]) { cell = (CustomCell *) currentObject; break; } } } //MiceAppDelegate *AppDelegate = (MiceAppDelegate *)[[UIApplication sharedApplication] delegate]; if(dataArray != nil) { // //NSArray *promoArray = (NSArray *) promotions; NSDictionary *datadict = [self.dataArray objectAtIndex:indexPath.row]; NSString *url = [datadict objectForKey:@"imageUrl"]; NSString *title = [datadict objectForKey:@"title"]; NSString *description = [datadict objectForKey:@"description"]; NSString *newAddressPartOfURL = [url stringByReplacingOccurrencesOfString:@" " withString:@"+"]; //NSLog([url stringByAddingPercentEscapesUsingEncoding:NSASCIIStringEncoding]); NSURLResponse *urlResponse; NSData *data = [NSURLConnection sendSynchronousRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:newAddressPartOfURL]] returningResponse:&amp;urlResponse error:nil]; // Configure the cell. UIImage *urlImage = [[UIImage alloc] initWithData:data]; // NSLog(@"%i",[imageView.image topCapHeight]); cell.title.text = title; cell.description.text = description; cell.image.image = urlImage; [urlImage release]; } return cell; } </code></pre>
 

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