Re: Force update
Re: Force update
- Subject: Re: Force update
- From: email@hidden
- Date: Thu, 12 Apr 2007 14:03:40 +0200
On Apr 12, 2007, at 9:59, Sherm Pendley wrote:
On Apr 12, 2007, at 3:44 AM, Bernard Meers wrote:
In my app I have a MVC architecture (model is a dictionary).
I binded my U.I. elements to this model and all is working fine,
meaning I get the necessary updates.
BUT now I added a while loop in which I measure pixels on the
screen and I would like to display these measured values in the U.I..
You really shouldn't be doing that. A while() loop will block the
run loop and prevent incoming events from being handled properly.
If it goes on for long enough your users will get a technicolor
pizza cursor.
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.
I did as you suggested and all works fine now.
Tx,
Bernard
_______________________________________________
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