iphone - How to increase the speed of the scroll in the table view when images are being loaded in each cell? -


before checking the previous lines [return cell] .. After the images are loading scrolling speed is decreasing..it find scrolling is stuck

  - (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath {static NSString * MyIdentifier = @ "MyIdentifier"; UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier: MyIdentifier]; If (cell == zero) {cell = [[[UITableViewCell alloc] initWithFrame: CGRectZero reuseIdentifier: MyIdentifier] autorelease]; } Int Story Story = [IndexPath IndexApision: [IndexPath Length] - 1]; NSString * itemDescription = [[Stories ObjectAttacks: Story Index] ObjectForreake: @ "Title"]; CGRact Ephram = CGRactack (80, 30, 250, 40); TextLabel = [[Uiblal Alloc] InitVithframe: Ephraim]; TextLabel.font = [UIFont boldSystemFontOfSize: 14]; TextLabel.numberOfLines = 0; TextLabel.textColor = [UIColor darkTextColor]; TextLabel.backgroundColor = [UIColor whiteColor]; [Cell.contentView addSubview: textLabel]; TextLabel.text = itemDescription; CGFF frame = CGRactam (0, 0, 7080); UIImageView * top imageview = [[UIImageView alloc] init]; [Cell.contentView addSubview: TopImageView]; TopImageView.frame = frame; M_strimage = [m_imglinkArray ObjectOutInx: Story Index]; TopImage = [[UIImage alloc] initWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: m_strImage]]]; TopImageView.image = topImage; Return cell; }  

Can you help me increase the speed of the book?

Regards

Arun

I believe That you can have two problems here. First, do not load the image and the second multi threading issue is how you are using UITableViewCell

whenever the iPhone cellForRowAtIndexPath calls on a cell screen. If you scroll down, everything is thrown up and are then reloaded you scroll back again as has already been noted, it can be solved with Maltithreding patterns - either linkj. Links posted on net, and / or using NSThread. The advantage of NSThread is that you have more flexibility to handle problems or load more with image data. (I can make responsible table cell for both will use)

In order to efficiently you must have a custom UITableViewCell it's good regardless because you're not the contents of your view controller, and you Can efficiently use cell formatting and content. Here's UITableCellView A link to the great Post:

When you implement UITableViewCell, so "if (take calls all Adswuv and formatting cell == null) , "Block, only if you can not keep them in your custom initWithFrame. You will find that the iPhone is stacking up every subview you add - it is not clearing the old scene. You can set the background color in "UIColor clearColor" and then change the text between the hits - you'll see a stack of text on top of each other it does not normally appear as solids-loaded background all "Old" attracts sub-scenes.

Before you consider implementing "model", you add these two methods. You've got a view and a controller but all of your data should be in the model. All image URLs, content, etc. should be in some NMSUtablesArra, which is your own custom object, or perhaps through SQLite. Once you have a model, you can apply your caching of images. With caching, all the images will be placed between the loads of your application which will save battery, bandwidth and time.

I want to: 1. all of your data model of some sort (NSMutableArray, SQLLite, a) 2. Apply your own custom UITableViewCell 3. Ensure that active blocks have Selforruv Attiaiandappath Inside there is 0 addSubView, init, or alloc call. 4. Use the delegation example or NSThread to load all the images in the background 5. Add local images caching

There are a few good examples about Apple forums on caching images.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -