• 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: Force update
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Force update


  • Subject: Re: Force update
  • From: Uli Kusterer <email@hidden>
  • Date: Thu, 12 Apr 2007 10:22:04 +0200

Am 12.04.2007 um 09:59 schrieb Sherm Pendley:
However I get no updates during the execution of the "while loop".
How can I force an update of the new values in the model??

You could create an NSTimer with a very short or no delay. If your timer callback, if the conditional that the loop depends upon is false, invalidate the timer.

Or you can call [foo performSelector: @selector(doOneLoopOperation) withDelay:0.0] repeatedly (i.e. every time you've finished one loop iteration, call it to schedule another). That'll give you the most CPU time and not limit you to a timer delay, but should still handle events between calls, if there are any.


Of course there's also threads, but the above mean you don't have to worry about concurrency bugs and race conditions, so you really don't want to use threads.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

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: 
 >Force update (From: Bernard Meers <email@hidden>)
 >Re: Force update (From: Sherm Pendley <email@hidden>)

  • Prev by Date: Re: Getting the context of a context menu
  • Next by Date: NSDrawer border width
  • Previous by thread: Re: Force update
  • Next by thread: Re: Force update
  • Index(es):
    • Date
    • Thread