Hi,
I am new to Cocoa and have been experimenting with NSRunLoop. I would
appreciate clarification about 'run' method semantics. The documentation
states that:

"If no input sources or timers are attached to the run loop, this method
exits immediately"

Yet, in my thread example below, the 'run' invocation blocks and does not
exit. MyThread is a simple NSThread subclass. No custom input sources or
timers are registered with the run loop. Unless I misunderstand the
documentation or there are some 'hidden' input sources or timers are
registered with the run loop, I would expect 'run' to exist immediately.
Would much appreciate help with sorting this out!

Thanks,
Roman Kishchenko

@implementation MyThread

- (void)main {

    NSLog(@"++ start");

    NSRunLoop *loop = [NSRunLoop currentRunLoop];

    [loop run];

    NSLog(@"++ finish");

}

@end
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to