• 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
performance of UIControls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

performance of UIControls


  • Subject: performance of UIControls
  • From: Memo Akten <email@hidden>
  • Date: Thu, 19 Feb 2009 21:25:45 +0000

Hi All, I have a UI with a lot of UISliders and UISwitches. For every single one I have an IBAction which updates an internal variable, I also have a pointer to every control in my controller so if a variable is updated programmatically it's updated in the UI. In my game's update loop I check those variables and act accordingly. I'm wondering if this is the best way to do this? I thought I could have one IBAction to handle all UIControls and just give them all different tags and have my parameters in an array etc, but still its a bit of a pain. There is a lot of variables, and every time I want to add a new parameter I need to:

- add a pointer to the control in the controller
- add an IBAction callback and set my internal variable
- add the control to a updateUI function which simply writes all variables to the controls to update the UI
- add the control to a readUI function which simply calls the callback for all of the controls to update the vars.


but I was wondering if I could just directly use the controls in my update loop? I would only use them once per update loop (for loops etc. I would cache the value first if need be). E.g. if (mySwitch.on) or velocity = velSlider.value? Or will this be slow? Is there a preferred method for these situations?


Memo (Mehmet S. Akten) www.memo.tv www.twitter.com/memotv www.vimeo.com/memotv


_______________________________________________

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: performance of UIControls
      • From: Michael Ash <email@hidden>
  • Prev by Date: Need recommendations for best way to build a custom view
  • Next by Date: Resizing NSCollectionViewItem's view to fit NSTextField
  • Previous by thread: Re: Need recommendations for best way to build a custom view
  • Next by thread: Re: performance of UIControls
  • Index(es):
    • Date
    • Thread