NSTask or NSThread?
Posted
by Ben Packard
on Stack Overflow
See other posts from Stack Overflow
or by Ben Packard
Published on 2010-05-02T06:34:09Z
Indexed on
2010/05/02
6:37 UTC
Read the original article
Hit count: 448
I have some code that is attached to an NSTimer. Around 5 times every second, it interacts with another application (by emulating keystrokes) and when appropriate spits out an NSNotification, that is handled by another piece of code.
While the timer code is running, the UI is unresponsive, so I can't include a 'stop' button that halts the timer.
How should I handle this? A separate process (NSTask right?) or thread? Remember that at unpredictable times, the timer code will need to send some info back for processing.
Thanks.
© Stack Overflow or respective owner