开发者

xcode loading the images in background process, it leads to crash the application when i scroll the tableview fast?

I have developed an application which has retrieved the information from remote location...so i pu开发者_开发技巧t those in UITableView's Section.In response, i will be getting images also..for this i put the background process(only for images..because the app will take more time to retrieve images than text based information..).It is working fine...But if i scroll the tableview while loading the images..it is going to be crashed.

crash Log:

Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...

Please provide its code to improve the answer..

could anyone has the solution for this..please let me know..how to resolve this crash...Even i used NSThread class for this.. but i didn't get the solution...


Maybe you "call to UIKit from a secondary thread". What's the code you use for background image loading? You should display a placeholder image before you get the real data, then notify the main thread (using performSelectorOnMainThread:withObject:waitUntilDone:) when you've finished downloading the image. Your main thread method should be responsible for all the drawing (the tableview, in this case).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜