NSRunLoop run semantics
NSRunLoop run semantics
- Subject: NSRunLoop run semantics
- From: "Roman Kishchenko" <email@hidden>
- Date: Sun, 7 Sep 2008 12:33:02 -0400
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 (email@hidden)
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:
This email sent to email@hidden