Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
- Subject: Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
- From: "Gary L. Wade" <email@hidden>
- Date: Thu, 17 Sep 2015 07:18:49 -0700
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 <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden
References: | |
| >Lost memory, GCD, dispatch sources, Cocoa bindings & User interface (From: Jean Suisse <email@hidden>) |
| >Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface (From: Quincey Morris <email@hidden>) |
| >Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface (From: Charles Srstka <email@hidden>) |
| >Re: Lost memory, GCD, dispatch sources, Cocoa bindings & User interface (From: Ken Thomases <email@hidden>) |
| >Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface (From: Quincey Morris <email@hidden>) |
| >Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface (From: Jean Suisse <email@hidden>) |
| >Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface (From: Quincey Morris <email@hidden>) |
| >Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface (From: Jean Suisse <email@hidden>) |
| >Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface (From: "Gary L. Wade" <email@hidden>) |
- Prev by Date:
Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
- Next by Date:
Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
- Previous by thread:
Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
- Next by thread:
Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
- Index(es):