Just as I thought. You're overloading the system by tightly coupling your model 
and your view. Let your instruments (models) do their work, and let your 
controller consult them when ready and update the view; don't use your 
controller to tell the models to update the views.

Using an office metaphor, you have 100 employees doing work, and they are told 
by a secretary to report their progress to their manager, and they are all 
going to the manager at the same time, all crowding in and stepping over each 
other. It's more efficient for a single secretary to jot that info down and 
take it to the manager.
--
Gary L. Wade (Sent from my iPad)
http://www.garywade.com/

> On Sep 17, 2015, at 7:25 AM, Jean Suisse <jean.li...@gmail.com> wrote:
> 
> Thanks for your reply. 
> If I understand you correctly, I am already doing all that by having one 
> updateUI function per instrument, which does:
> 
> self.myProperty = self->myStorageVariable
> 
> on every variables.
> All updateUI selectors are sent to all instruments, at the same time, from 
> the main thread by a timer dispatch source, once every second.
> 
> 
> 
>> On 17 sept. 2015, at 16:18, Gary L. Wade <garyw...@desisoftsystems.com> 
>> wrote:
>> 
>> Also, in case you're pulling multiple values per instrument object in your 
>> new timer (e.g., temperature, time, frequency, etc.), and these may be 
>> updating on background threads, a simple way to get these is to pull all the 
>> values needed into local variables in a synchronize block based on the 
>> particular instrument object. Just be sure to do the same on your background 
>> threads when updating them; using the synchronize block to set multiple 
>> values at once is better than using multiple atomic properties.
>> 
>> This also helps present a more unified front for your data per instrument 
>> since individual updates may show a temperature from the last reading and a 
>> frequency from this reading whereas a single full-pull will show the user 
>> only the one reading.
>> --
>> Gary L. Wade (Sent from my iPad)
>> http://www.garywade.com/
>> 
>>> On Sep 17, 2015, at 6:47 AM, Gary L. Wade <garyw...@desisoftsystems.com> 
>>> wrote:
>>> 
>>> Okay, so what it appears you have is over 100 timers being fired whose only 
>>> purpose is to transfer a single value from one variable to another so that 
>>> bindings will hear that change and update your UI.
>>> 
>>> A better approach is to remove bindings completely, make a single timer on 
>>> the main queue that fires every quarter-second (I believe that was your 
>>> interval from another email), which is associated with the view/window 
>>> controller that manages all your text fields and instrument objects, have 
>>> that timer use a single cached formatter and loops through all your 100+ 
>>> objects, getting their values, formatting them, and setting each 
>>> appropriate text field's string value.
> 
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to