• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: updating UI during long loop using cocoa objective-c
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: updating UI during long loop using cocoa objective-c


  • Subject: Re: updating UI during long loop using cocoa objective-c
  • From: "Corey O'Connor" <email@hidden>
  • Date: Sat, 31 Mar 2007 22:12:15 -0700

On 3/31/07, Jerry Krinock <email@hidden> wrote:


On 2007 Mar, 31, at 20:45, I. Savant wrote:

Allow me to return some good advice someone gave me a few weeks ago:
Before you delve into multithreading, consider running your window as
a "modal session".  Poorly documented, no sample code, but simple if
you can get it to work.  Start by reading the documentation for:
         -[NSApplication beginModalSessionForWindow:]
It's really weird because the NSModalSession is a struct, but just go
along with it.  Another hint: Use the strangely-named method:
        -runModalSession:
when you want to update your view.



I think, though I haven't tried, a similar effect can be had by sendign the runUntilDate message to the application thread's run loop. If you pass in a date that is a suitable short time from now, say 1/60th of a second, I think that allows the UI to be updated and prevents the spinning wheel o' death. YMMV though: Never tried it; just infered from the documentation. Couldn't find the one that reviewed the cocoa event system though.


-- -Corey O'Connor _______________________________________________

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


References: 
 >updating UI during long loop using cocoa objective-c (From: <email@hidden>)
 >Re: updating UI during long loop using cocoa objective-c (From: "I. Savant" <email@hidden>)
 >Re: updating UI during long loop using cocoa objective-c (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: updating UI during long loop using cocoa objective-c
  • Next by Date: Keyboard Loop in Programmatically Created Window
  • Previous by thread: Re: updating UI during long loop using cocoa objective-c
  • Next by thread: Keyboard Loop in Programmatically Created Window
  • Index(es):
    • Date
    • Thread