Re: How to Observe All attributes of a Class Object from the Controller.
Re: How to Observe All attributes of a Class Object from the Controller.
- Subject: Re: How to Observe All attributes of a Class Object from the Controller.
- From: mmalcolm crawford <email@hidden>
- Date: Fri, 16 Dec 2005 10:23:12 -0800
On Dec 16, 2005, at 8:14 AM, Janakiram wrote:
I have a class name Student . My Controller is observing all the
properties of the Student Objects. To Observe each attribute of
Student , presently i am writing
addObserver:forKeyPath:options:context: method. Is there any other
way which helps me to reduce the number of lines if the class
attributes increase.
There is no other API to add an observer for multiple properties
simultaneously. Instead, you could define a method for your model
class to return the relevant observable properties as an array, and
iterate over that. See Graphics Bindings at <
http://homepage.mac.com/
mmalc/CocoaExamples/controllers.html>.
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden