nsrunloop
How to send selectors or blocks to an NSRunLoop to perform?
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[详细]
2023-01-20 05:59 分类:问答StatusItem menu blocks main thread when it's opened. Workaround?
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[详细]
2023-01-18 05:52 分类:问答NSRunLoops in Cocoa?
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[详细]
2023-01-17 07:15 分类:问答Looping a CFRunLoopSource
Here is the source files I\'m currently developing. The idea behind this class is to contain a target object[详细]
2023-01-15 00:04 分类:问答Why is my application terminating in the middle of unit tests?
The Problem I run my unit tests. At one point, I wait using: [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeInt开发者_运维技巧ervalSinceNow:1]];[详细]
2023-01-14 12:45 分类:问答How do I prioritize performSelectorOnMainThread against NSConnection messages?
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.[详细]
2023-01-11 01:48 分类:问答Error at NSRunLoop after returning from thread method with NSAutoreleasePool
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[详细]
2023-01-10 17:22 分类:问答how to stop a timer triggered runloop?
if i set up a runloop like that: NSRunloop* loop = [NSRunloop currentRunLoop]; [runLoop addTimer:anyTimer forMode:NSDefaultRunLoopMode];[详细]
2023-01-08 01:56 分类:问答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[详细]
2023-01-07 22:54 分类:问答How can I do something when a runloop event is done processing?
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.[详细]
2023-01-03 19:00 分类:问答