views:

81

answers:

4

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.??

+1  A: 

Hello,

What is the size of your images ? In the same idea, what is the length of the text used ?

If your images are too big, it may slow down the scroll. The same for the text (but it needs a lot of text ^^)

Vinzius
my images is 25x25, but length of the text is variety, there's 10-20 letter, i thought the problem is about size of image, so i resized it to 25x25, but it still scroll slowly.. :( extension of my images is .jpg
Imam Arief W
As proposed @Anil Sivadas, try commenting some lines to check what is slowing down your scroll view. By the way, where are you running the app ? simulator ? device (which one if yes).
Vinzius
iam running on device. on simulator its scroll fast, but when install on device its getting slower, not slow i think, but it doesn't perfect scrolling.. sometime be startled although it still scrolling.
Imam Arief W
A: 

Is your image that you put into UITableViewCell is big?

I think you can try to comment the line loading the image to see if it is faster. I don't see any problems in your code

vodkhang
no it just 25x25, i've been try it guys, but nothing happen, the question its same as @anil sivadas
Imam Arief W
yeah, I think anil is correct, your problem is inside of the dictionary and array looks up somehow
vodkhang
+2  A: 

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.

Anil Sivadas
i've been try to comment the images code, but nothing happen. n wehn i try to change the text into @"some text"; it scroll faster.. but it's impossible to change the text :(
Imam Arief W
Put your detailedtext strings in one array directly instead of dictionary. It could help
Anil Sivadas
i've even already comment the detailText, but scrolling still slow,.. hmmp i think its not slow now but not smooth too.. :(
Imam Arief W
A: 

Just try restart your device. Sometimes device tend to go slow if it is "on" for many days! Believe me!

Raj
This suggestion I have given considering that none of the solutions provided by others have been helpful to you. I see no reason why it should happen though. If this is the case, then the whole application should be slow.
Raj