• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSRunLoop run semantics
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSRunLoop run semantics
      • From: Chris Kane <email@hidden>
    • Re: NSRunLoop run semantics
      • From: Bill Bumgarner <email@hidden>
  • Prev by Date: Interface Builder changing size of controls...
  • Next by Date: Re: Forcing finalization on the main thread?
  • Previous by thread: Re: Interface Builder changing size of controls...
  • Next by thread: Re: NSRunLoop run semantics
  • Index(es):
    • Date
    • Thread