AFAIK, a thread can not access UI components. But I want to preload images in a background thread and then display these in an UIImageView. Do I have to use special methods to access UIImageView 开发者_如何学JAVAin the main thread then?
If I understood your question correctly, you're half correct. Threads can access UI components, but only the main thread can do it reliably. Your background thread can use performSelectorOnMainThread:withObject:waitUntilDone:
to call up selectors in the main thread, and from those selectors interact with the UI.
Example:
[self performSelectorOnMainThread:@selector(updateImage) withObject:nil waitUntilDone:YES];
精彩评论