views:

68

answers:

1
+1  Q: 

iPhone programming

hi all,

i try to display UIImage from url in tableview cell but it's not scroll soomthly.

at time to scroll image is not cashed and every time its goes to url to display and scroll is stick some while

[cell setProductImage:[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[dict_productinfo valueForKey:@"productimage"]]]]]

i make custom cell and put imageview on that to display image

+1  A: 

Try loading your images asynchronously. Your main thread has to wait for each image to be loaded before it can continue to draw your table view.

This might be a litte too complex to explain here so take this sourcecode as a reference

Henrik P. Hessel
As he says you don't want to block the UI thread. Also see this documentation: http://developer.apple.com/iphone/library/documentation/General/Conceptual/ConcurrencyProgrammingGuide/OperationObjects/OperationObjects.html
Nimrod