开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜