Basic NSArrayController NSTableView bindings question
Basic NSArrayController NSTableView bindings question
- Subject: Basic NSArrayController NSTableView bindings question
- From: Steve Weller <email@hidden>
- Date: Mon, 22 Aug 2005 22:05:46 -0700
I'm missing something in trying to get an NSTableView to display the
content of an array.
I have a document-based application that contains a NSMutableArray of
objects of type MyClass call myArray. My table has columns headed
Native and Decimal. MyClass has two ivars, both NSString, called
nativeString and decimalString. I am doing the following:
1. Drag an NSArrayController into the MyDocument.nib window
2. Add nativeString and decimalString as attributes of the
NSArrayController and change Object Class Name to MyClass
3. Bind the contentArray of the NSArrayController to File's Owner
(MyDocument), Model Key Path myArray
4. Selecte the Result table column header and fill in the binding for
value as Bind to: NSArrayController, Controller Key: arranged
Objects, Model Key Path: nativeString
5. Repeat for the Decimal column header with a different Model Key
Path setting.
Nothing appears in my table when I run my program, although I know
there is content in the array. I get nothing in the log. My program
fills the array with
[myArray addObjectsFromArray:result];
where result is an array of MyClass object instances.
Do I have to create accessors in order to use bindings for this? Is
so, what accessors are needed and for what class?
--
Watch me learn Cocoa http://homepage.mac.com/bagelturf/
_______________________________________________
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