• 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
Correct Bindings Practices
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Correct Bindings Practices


  • Subject: Correct Bindings Practices
  • From: Chase Meadors <email@hidden>
  • Date: Wed, 20 Jan 2010 21:51:02 -0600

I have a couple of questions about the practices I'm using for bindings in my app.

1. Doing work in the setter:

Something I do alot when making models & custom views. For example, I might have a layer subclass that exposes a binding called "concentration." I @synthesize the property, but I override the setter to do all the work involving calculations, modifying sublayers, colors, etc. Is this a common practice, or is there some other way I should be doing it?

2. "Work in progress" objects:

I have a model object that exposes only an array as it's only binding. The model manages text files and reads/modifies them in accordance to it's array binding. Since adding an object to an array could be potentially large process, I want to let the user "construct" an object before ever adding it to the array. I've solved this by simply letting my controller have possession of a "thingToAdd" object that the user can change and modify. Then the add button will cause the controller to actually set the new array on the model. Again, is this a common practice?

Thanks alot for your time!
_______________________________________________

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: Correct Bindings Practices
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Problem using bindings with deep key paths
  • Next by Date: [moderator] Re: Moderated post on self going out of scope
  • Previous by thread: Re: iPhone:NSURLConnection and keep-alive
  • Next by thread: Re: Correct Bindings Practices
  • Index(es):
    • Date
    • Thread