Re: updating UI during long loop using cocoa objective-c
Re: updating UI during long loop using cocoa objective-c
- Subject: Re: updating UI during long loop using cocoa objective-c
- From: Bob Smith <email@hidden>
- Date: Mon, 2 Apr 2007 14:40:42 -0700
On Apr 2, 2007, at 7:53 AM, Keary Suska wrote:
However, when using beginModalSession/runModalSession you can call
the main
run loop after runModalSession using:
[[NSRunLoop currentRunLoop] runUntilDate:
[NSDate dateWithTimeIntervalSinceNow:0.1]];
This trick has many (desirable) side effects, one of which is
releasing the
main autorelease pool.
But it may have one very un-desireable side-effect; it will cause
events to be handled for _all_ windows in the app, not just the one
targeted by the modal session. The whole point of a modal session is
to "lock down" the UI so your app responds to only very limited user
input, i.e. a "Cancel" button, so you can perform a time-consuming
update of the rest of the UI without having to deal with user actions
on the affected views. (That's more or less the definition of
"modal".) If you are going to iterate the run loop in normal mode
anyway, why bother with the modal session at all?
Bob S.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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