I need to guarantee that the same thread performs various actions at arbitrary times. First the thread needs to initialize a library, then I want the thread to sleep until work needs to be done and up
I\'ve written an app for the Mac that is designed as a status bar item. However, when a user opens its menu fr开发者_如何学编程om the status bar, the main run loop is blocked until it\'s closed. Since
Let\'s say I have 2 threads, one is the main thread and another one, a secondary thread. The main thread is being used the most, but sometimes (rarely) I want the secondary thread to do some work base
Here is the source files I\'m currently developing. The idea behind this class is to contain a target object
The Problem I run my unit tests. At one point, I wait using: [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeInt开发者_运维技巧ervalSinceNow:1]];
I have a lot of NSURLConnections downloading.They may not happen on the main thread.When some of them finish, I call performSelectorOnMainThread for a separate singleton object.
I am getting an EXC_BAD_ACCESS error after I return from a thread method in which I have set up an NSAutoreleasePool.The place of failure is at a call to NSRunLoop.I am trying to wrap a 3rd party libr
if i set up a runloop like that: NSRunloop* loop = [NSRunloop currentRunLoop]; [runLoop addTimer:anyTimer forMode:NSDefaultRunLoopMode];
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
I have some processing in my Cocoa app that sometimes ends up calling through a hierarchy of data to do a bunch of work as the result of an event. Each small piece creates and destroys some resources.