0

I have 3 item in a single row. The every item is quite customized. On the start it load 6 item means 2 rows. but when I scroll and it reaches to almost end of send row then its load the 3 row. Between this it show a jerk of mili seconds.

Is there any way to load minimum 5 rows. If user scroll to the 2nd row it load the 6th row and so on...

Please Help..

Arahim
  • 303
  • 1
  • 6
  • 14
  • if you are loading images in to your collectionview then you have to use asynchnoze loading image using one of the SDWbimage,NSCache or AFNetworking for loading image. – Nitin Gohel Apr 23 '14 at 07:07
  • Can you show some code how you implement `UICollectionView`? – ChintaN -Maddy- Ramani Apr 23 '14 at 07:10
  • I have images in my application bundle and I simple used. cell.bgImg.image=[UIImage imageWithContentsOfFile:[[CacheDirectory stringByAppendingPathComponent:@"bg"] stringByAppendingPathComponent:[NSString stringWithFormat:@"bg%@.jpg",[dict objectForKey:@"bgFileName"]]]]; – Arahim Apr 23 '14 at 07:11
  • Actually it is quite difficult to show the code becoz its totally mixed up.. Orignally the code is written by anouther developer... very difficult to show it... it is quite ugly code – Arahim Apr 23 '14 at 07:15
  • Nitin, Chinttu and dee what do you guys think about this solution. I think it will used more memory. http://stackoverflow.com/questions/12268812/uitableview-load-all-cells – Arahim Apr 23 '14 at 07:29

1 Answers1

0

If you are trying to load network resources in UITableViewCell , you better asynchronize loading those resources.

If you try to load 6th row when you scroll to 2nd row. I guess UITableViewCell visibleCells is a way to load more cells' resources in advance .

Weizhi
  • 174
  • 4
  • 22
  • Dee Thx for your reply but visibleCells only return an NSArray. – Arahim Apr 23 '14 at 07:19
  • That NSArray contains UITableCell, eg. indexPath of (0,1),(0,2). Then you can load (0,3).Am I right – Weizhi Apr 23 '14 at 07:35
  • hmm.. I am trying it. could you please show me little code. It will be help.. NSArray *temp = [collectionVw visibleCells]; on view did load and it has 0 objects – Arahim Apr 23 '14 at 08:07