Cocoa Run Loop Input Sources
I am writing an iPhone application, and I need to download files in the background. I can handle the download files part, but I am not so sure about the background part. My current idea is to use a run loop to wait until the user selects a file to download. This appears to work, but a run loop exits if no input source is set. However, Apple 开发者_C百科docs say something about a predefined custom input source allowing you to use the function
performSelector:onThread:withObject:waitUntilDone: to run a function. I would like to know how to add that input source to the run loop.It turns out NSThreads worked better than the run loop idea.
精彩评论