Re: Stacking run loops
Re: Stacking run loops
- Subject: Re: Stacking run loops
- From: patrick machielse <email@hidden>
- Date: Thu, 16 Dec 2004 12:56:30 +0100
Op 16-dec-04 om 5:51 heeft Ricky Sharp het volgende geschreven:
Here are two methods I've implemented in my app controller:
- (void)runDialogScreen:(int)aScreenID
{
[self pushScreen:aScreenID];
CFRunLoopRun();
[self popScreen];
}
Here, pushScreen: will load a nib for the given screen ID. That nib's
owner is a controller for that particular screen (in this case the
about dialog).
After the nib is loaded, the main window's content view is replaced
with the content view from a well-named panel object in the nib (the
about dialog UI).
The controller for the about dialog then has an IBAction for
okButtonPressed. In that method, I call the app controller's
endDialogScreen:
- (void)endDialogScreen
{
CFRunLoopStop ([[NSRunLoop currentRunLoop] getCFRunLoop]);
}
I can't comment directly on your situation, but I've found that you
shouldn't mix CFRunLoop and NSRunLoop. Especially, I could not get the
construct:
CFRunLoopStop ([[NSRunLoop currentRunLoop] getCFRunLoop]);
to stop a RunLoop started with CFRunLoopRun(). The setup that finally
worked for me was:
CFRunLoopRef runLoop = CFRunLoopGetCurrent();
CFRunLoopRun();
...
CFRunLoopStop(runLoop);
Don't know why, but this worked for me.
Patrick
---
Hieper Software
e: email@hidden
w: www.hieper.nl
_______________________________________________
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