Re: How to add response to Null event
Re: How to add response to Null event
- Subject: Re: How to add response to Null event
- From: Brent Gulanowski <email@hidden>
- Date: Thu, 06 Sep 2001 22:24:17 -0400
>
From: Ondra Cada <email@hidden>
>
Reply-To: email@hidden
>
Date: Thu, 6 Sep 2001 11:03:49 +0200
>
To: Andreas Monitzer <email@hidden>
>
Cc: email@hidden, email@hidden
>
Subject: Re: How to add response to Null event
>
>
Andreas,
>
>
>>>>>> Andreas Monitzer (AM) wrote at Wed, 5 Sep 2001 22:49:55 +0200:
>
AM> >Hello all,
>
AM> >I need to do something during idle(or null event) in event loop. I can
>
AM> >do this in Mac OS 9 but I don't know how to do this in Cocoa. If I need
>
AM> >to subclass NSApplication, or there are other easy ways.
>
AM>
>
AM> There's no idle event in preemptive multitasking.
>
>
It has nothing to do with that. Those ideas are orthogonal -- with
>
preemptive multi_tasking_ there's no difference at all, with p.
>
multi_threading_ you can choose between idle event and extra thread,
>
whantever suits you better.
>
>
AM> Use NSTimer instead.
>
>
Or performSelector:withObject:afterDelay:, which might be easier for the case.
Um, which object would be the wisest to send this to initially? And would it
be best sent at -awakeFromNib? The docs don't say that this is an infinitely
repeating thing, but I could do recursive thing where at the end of the
idle-task method, I could call
[self performSelector:@selector(_cmd) withObject:someObject afterDelay:
timeDelay]
Would that be safe? someObject could hold a boolean variable which, if set
to NO, would not continue the recursion. Is this like some kind of
pseudo-thread? Or is the runtime system just holding the message in a
wait-state before dropping it into the queue for objc_msgSEnd()?
BG
>
---
>
Ondra Cada
>
OCSoftware: email@hidden http://www.ocs.cz
>
private email@hidden http://www.ocs.cz/oc
>
_______________________________________________
>
cocoa-dev mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev