Correct Bindings Practices
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