Re: Force update
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