discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSNotification and NSRunLoop


From: Chris B. Vetter
Subject: Re: NSNotification and NSRunLoop
Date: Tue, 28 Oct 2003 17:48:10 -0800

On Tue, 28 Oct 2003 20:29:23 -0500
"Yen-Ju Chen" <address@hidden> wrote:
>   I try to send NSNotification via NSDistributedNotificationCenter to
>   a GNUstep tool which use while(...){} to keep alive.
>   I notice that all the NSNotification reach the tool after the while
>   loop stop. Why does it happen ?

while() blocks.

>   Do I have to use NSRunLoop in order to receive NSNotification in the
>   middle of while loop ? How to do that ? Something like this ?
[...]

No, but you could create a method that contains your while() loop. That
method can then be added to an instance of NSRunLoop.
That is, create an NSTimer, add the method, add the timer to NSRunLoop
and fire off the timer instantly (and only once).

>   Then how far the [NSData distantFuture] would be ? More than one
>   second ?

No, in terms of centuries.

-- 
Chris




reply via email to

[Prev in Thread] Current Thread [Next in Thread]