Re: NSObjectController HELP
Re: NSObjectController HELP
- Subject: Re: NSObjectController HELP
- From: Vince Ackerman <email@hidden>
- Date: Sun, 6 Jun 2004 00:15:40 -0700
The docs for the controller objects reference changing the instance
variables without accessor methods.... I thought that was the whole
point? What is it that the controller is doing then...? I was under
the impression that the NSObjectController was responsible through KVO
to update the bound object. It observers the instance variable and
updates the bound object as the variable changed. If I have to write
special accessor methods then I might as well go back and put my glue
code using IBOutlet's and notifications back in my project...... Not
much of a labor saving device if that's the case. Are you saying my
floats and Booleans have to be NSNumber objects and use those set/get
methods? So far I haven't been able to get it to update the NSString
obj either.......
This is from the controller docs:
Model Layer Features
Data and data structures compose the model layer of a Cocoa
application. Data structures are often objects from the Foundation
framework, such as NSArray and NSDictionary, or objects from the
Application Kit framework, such as NSDocument, but they often also
include primitive C data types. The controller layer provides
mechanisms to display and edit all standard Cocoa data types without
writing any code.
This leads me to believe that I should be able to bind a primitive data
type to an interface object . What is it that I have to do
differently? Why does it get the initial value on startup, but not the
updated value? What are you guys saying? Go easy on me, I'm a babe in
the woods here...... trying to learn this stuff too.
Thanks
Vince
On Jun 5, 2004, at 21:50, mmalcolm crawford wrote:
>
>
On Jun 5, 2004, at 9:29 PM, Vince Ackerman wrote:
>
>
> The problem is that the textfields that are bound to the instance
>
> variables don't seem to see the changes in my instance variables
>
> (when they are changed as the app runs) and update themselves
>
> accordingly. Maybe I misread the docs, but I thought that KVO meant
>
> the bound object would be updated as the instance variable changed?
>
> Why would they see the initial values but not the changes as it
>
> executes?
>
>
How are you changing the instance variables' values? You cannot
>
change them directly, KVO requires that ou use appropriate accessor
>
methods.
>
>
mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.