Re: Let the runloop process its queue during a long operation
Re: Let the runloop process its queue during a long operation
- Subject: Re: Let the runloop process its queue during a long operation
- From: Dave Keck <email@hidden>
- Date: Thu, 7 Oct 2010 05:41:23 -0400
> But this is for Carbon application, isn't it? I have a cocoa one...
No – NSRunLoop is built atop of CFRunLoop, just as many Foundation
classes are built atop CoreFoundation classes. Carbon has nothing to
do with it.
> Does this call operate with the core foundation run loop, bypassing
> cocoa's one?
They're one and the same.
> And if it's allowed to use it in cocoa app, what should i specify as
> the second parameter (timeInterval)? 0 doesn't seem to work at all
> (the run lop is not relaunched at all), 1 sec gives big delays, if
> nothing has been pressed - it seems that "sourceHandled" means "at
> least one event in queue is handled, if the queue is empty - just wait
> that timeinterval". But then, setting any interval>0, i force my
> application to wait, instead of processing that big file.
> Or maybe i'm understanding something wrong?
For your situation, you shouldn't need to deal with the run loop
directly. Normally you'd want to use a separate thread, NSOperation,
etc., but since you're using AppleScript, that's out of the question
since it's confined to the main thread.
See the docs for NSApplication's -runModalSession: – that's probably
your best bet.
_______________________________________________
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