Possible Duplicate:
UIImage in uitableViewcell slowdowns scrolling table
I filled my table view data with plist file which will download from a server . but after user scrolls the table the scrolling is very slow ! this is my code :
//this is my plist code that load from server
NSURL *url = [NSURL URLWithString:@"http://example.com/news.plist"];
titles = [[NSArray arrayWithContentsOfURL:url] retain];
tableview :
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return titles.count;
return subtitle.count;
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
}
tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg.gif"]];
// Configure the cell.
NSUInteger row = [indexPath row];
cell.textLabel.text = [titles objectAtIndex:row];
cell.textLabel.textColor = [UIColor darkGrayColor];
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.detailTextLabel.text = [subtitle objectAtIndex:row];
cell.detailTextLabel.numberOfLines = 6;
cell.detailTextLabel.backgroundColor = [UIColor clearColor];
//gradiant BG for cells
UIImage *image = [UIImage imageNamed:@"bg2.gif"];
UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
imageView.contentMode = UIViewContentModeScaleToFill;
cell.backgroundView = imageView;
[imageView release];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
tableView.separatorColor = [UIColor lightTextColor];
return cell;
}
Thank you for telling me what's is my problem