Re: NSObjectController HELP
Re: NSObjectController HELP
- Subject: Re: NSObjectController HELP
- From: Vince Ackerman <email@hidden>
- Date: Wed, 02 Jun 2004 22:14:06 -0700
Re: NSObjectController HELP
Cc: email@hidden
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Return-Path: : email@hidden
I'm a newbie, but Wow, this is the least intuitive part of Cocoa I've come acoss (or I'm just stupid). I Fixed the error with the boolean, but now can't get any of the bindings to work. I've tried to follow the limit bits of documentation religiously, but they all deal with tables for some reason. Maybe someone could hold my hand and step me through this? I just want (for a start, at least) to bind my NSTextField's in my main window to the instance variables in my model object. I've read the docs on bindings and controllers until I have a headache, but don't seem to grok this stuff.
I've created an instance of NSObjectController:
I control dragged a connection between my model object and the controller and connected the content.
In the info window for my NSObjectController, under attributes, set my model object name to "TeleoObj", the two check boxes are checked, and I have added keys matching my instance variables below.
Do I have to do anything else here?
My Model object :
@interface TeleoObj : NSObject
{
NSMutableString * NetStatusUSBBox;
NSMutableString * NetStatusMsgBox;
NSMutableString * NetStatusAinBox;
NSMutableString * AddressEWBox;
BOOL NetWLimitBox;
BOOL LimitEWSwitch;
BOOL LimitNSSwitch;
float NetAnInBox;
float NetPosNSBox;
float NetPosEWBox;
.... }
Next I went to the main window and each of my NSTextField's and chose Bindings. Selected values: then set the Bind to: to my object controller, Controller Key: selection, and Model Key Path: to the associated key.
I want these to update continuously, and only a few of the text fields are editable. What else do I need to connect? Do I have to drag connections between any of these if they're not using IBOutlet any more?
I initialize each of the instances in my models' awakefromnib method. When I run the app, nothing is displayed in any of the textfields.
What am I doing wrong?
Thanks in advance for your help
Vince
On Jun 1, 2004, at 21:43, Scott Anguish wrote:
it sounds like you've got a binding that expects a BOOL value connected without a model key, or to the wrong keypath.
On Jun 1, 2004, at 4:12 PM, Vince Ackerman wrote:
I decided I'd jump in and create a controller object for my GUI. That was a mistake.... I admit I really have no idea what I'm doing even after reading all the Developer notes on NSObjectController. I changed all the IBOutlet's into int, float and BOOL and NSString* in my Model Object. I created a controller object and selected my Model object as it's content connection. I then added all of my Model's variables as key's under the Controller's Attribute window.
_______________________________________________
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.