Re: Confused about CFRunLoop
Re: Confused about CFRunLoop
- Subject: Re: Confused about CFRunLoop
- From: "Kyle Sluder" <email@hidden>
- Date: Mon, 17 Mar 2008 23:52:09 -0400
On Mon, Mar 17, 2008 at 11:26 PM, Brian Greenstone <email@hidden> wrote:
> I was using NSTimer originally, but I was having the exact same
> problem since NSTimer is really just a CFRunLoopTimerRef according to
> the docs. As far as I can tell, using NS calls to do this is just a
> more complicated way than simply calling CF directly to do it without
> all that Obj-C gibberish.
I really can't find a better way to say this, so here it goes: the
"Obj-C gibberish" you refer to is an entire object-oriented platform,
and is *the* canonical way to develop applications for OS X. It seems
you don't fully understand what Cocoa is, and that might be the root
of your problems. As MC Lars would say, "I hate to say it, but
welcome to the future." This is cocoa-dev after all.
That said, for what you're doing, you would not create a run loop and
run it yourself. Creating a new run loop will, as you surmised, send
yourself into what amounts to a modal loop. Events (mouse, keyboard,
ink, Apple Events...) come in from the window server and get queued in
some input that's attached to the main thread's run loop. If you're
spinning in your own run loop, your main run loop will never get the
opportunity to process and dispatch those events. So you will need to
create a timer (NSTimer or CFRunLoopTimerRef) and schedule it on the
existing run loop in the modes you need.
--Kyle Sluder
_______________________________________________
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