• 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
Re: Stopping a NSRunLoop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stopping a NSRunLoop


  • Subject: Re: Stopping a NSRunLoop
  • From: Andrei Tchijov <email@hidden>
  • Date: Tue, 23 May 2006 15:49:48 -0400

I guess if you can "remove" all sources from RunLopp ... but than it should stop by itself without CFRunLoopStop ... In my case I needed to stop RunLoop which was "primed" like this

[[NSRunLoop currentRunLoop] configureAsServer];

combination of getCFRunLoop and CFRunLoopStop did not work, so I end- up using Apple example

double resolution = 1.0;
BOOL isRunning;
do {
NSDate* next = [NSDate dateWithTimeIntervalSinceNow:resolution];
isRunning = [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:next];
} while (isRunning && !endRunLoop);


works great.


On May 23, 2006, at 3:43 PM, Mike Blaguszewski wrote:

On May 23, 2006, at 3:22 PM, Andrei Tchijov wrote:

Do not bother with getCFRunLoop/CFRunLoopStop. It does not work. Your own loop with terminal condition and runMode:beforeDate: the only way to go (this is actually the way promoted in Apple doc about Run Loop)

I've had some success starting a runloop with CFRunLoopRun(), then using (I believe) CFRunLoopStop(CFRunLoopGetCurrent()) to end it. This was in the main thread of a Foundation tool, though, where I needed NSNotifications to work. And I don't have the code handy anymore to verify the details.


--
Mike Blaguszewski / Ambrosia Software, Inc.



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Stopping a NSRunLoop
      • From: Bill Bumgarner <email@hidden>
References: 
 >Stopping a NSRunLoop (From: Rob Crawford <email@hidden>)
 >Re: Stopping a NSRunLoop (From: "Shawn Erickson" <email@hidden>)
 >Re: Stopping a NSRunLoop (From: Andrei Tchijov <email@hidden>)
 >Re: Stopping a NSRunLoop (From: Mike Blaguszewski <email@hidden>)

  • Prev by Date: Re: Stopping a NSRunLoop
  • Next by Date: Bold Text
  • Previous by thread: Re: Stopping a NSRunLoop
  • Next by thread: Re: Stopping a NSRunLoop
  • Index(es):
    • Date
    • Thread