Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableView Scroll slowly

i got the problem in my apps, i have UITableView and it's scroll slowly, not as fast as the other application, even i didn't create any object or add subview in my table
this is my code :

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {  
static NSString *searchingIdentifier = @"searchingIdentifierCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:searchingIdentifier];  
if (cell == nil) {  
        cell = [[[UITableViewCell alloc]   initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:searchingIdentifier]autorelease];  
        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    }  
cell.detailTextLabel.text =[[self.dataStoreByCategory objectAtIndex:indexPath.row]objectForKey:@"storeLevel"];

    cell.textLabel.text = [listStore objectAtIndex:indexPath.row];  
    cell.imageView.image = [[self.dataStoreByCategory   objectAtIndex:indexPath.row] objectForKey:@"storeIcon"];
}

somebody can help me.??

like image 965
Imam Arief W Avatar asked Dec 16 '25 19:12

Imam Arief W


1 Answers

This mainly happens when the contents you are using in the cell is of large size.

In your case, the images you are using in the cells might be of very large size. You can check it by commenting the code and testing it.

To sort out the problem, make an array of thumb nail images to be displayed on the cell instead of the original images. You could find some methods to make the thumb nail of an image by reducing the height and width of image.

If you use the thumb nail images inside the tableview, your table would scroll faster. When the user select any table row, you can display the full image in your next view as required in your application.

like image 93
Anil Sivadas Avatar answered Dec 19 '25 13:12

Anil Sivadas