Re: Managing the event loop in Cocoa
Re: Managing the event loop in Cocoa
- Subject: Re: Managing the event loop in Cocoa
- From: Michael Watson <email@hidden>
- Date: Thu, 28 Jun 2007 03:28:05 -0400
What I'd probably ask is why you need to run the event loop manually.
What is it that your application needs to do? (Not saying you don't
have to for whatever reason, but that's the first thing that crosses
my mind.)
--
m-s
On 28 Jun, 2007, at 03:02, Jeff Bland wrote:
Hello everyone,
I recently begin porting an application from Carbon to Cocoa, and
things are
going well (objective-c[++] is surprisingly simple, even though I
was a bit
scared at first).
One thing my applications needs to do is to run the event loop
manually. It
is an API that works not by returning control to the end
application during
events, but instead leaves the end application in charge of the
main loop.
I achieved this in Carbon by using a custom event to break out of
RunApplicationEventLoop() (which i needed so I could use the standard
application handler), then using ReceiveNextEvent() to check the
event queue
manually when the end applications calls one of my API functions.
In Cocoa documentation, it says that you can manage the run loop by
deriving
from NSApplication (though it's not recommended), and notes that
overriding
run is "a critical and complex task, however, that you should only
attempt
with good reason.)".
So should I override run, or would it be possible/better to use a
custom
event to break out of loop in the application run method as I did
in Carbon.
Where can I find more info on the previously mentioned complexities
of the
run method?
Thanks,
- Jeff Bland
_______________________________________________
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:
40bungie.org
This email sent to email@hidden
_______________________________________________
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