• 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: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface


  • Subject: Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
  • From: Jean Suisse <email@hidden>
  • Date: Thu, 17 Sep 2015 16:25:38 +0200

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 <email@hidden> 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 <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

_______________________________________________

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


  • Follow-Ups:
    • Re: Lost memory, GCD, dispatch sources, ?Cocoa bindings & User interface
      • From: "Gary L. Wade" <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>)
 >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):
    • Date
    • Thread