Get Value from NSArrayController Binding
Get Value from NSArrayController Binding
- Subject: Get Value from NSArrayController Binding
- From: Christian Isaacs <email@hidden>
- Date: Mon, 2 Jun 2008 12:08:31 -0400
Hello Everyone!
I currently have an AppContoller with a method named events that
returns an NSArray. This NSArray contains a collection of events
returned by the CalCalendarStore eventsWithPredicate method. In IB I
have an NSArrayController named Events that is bound to my
AppController events NSArray. I also have an NSTableView with one
column and it's value is bound to Events.arrangedObjects.title.
Everything works perfectly!
However, I then sub-classed NSCell to do some custom drawing of the
cell and would like to put the title of an event in the cell. I am
using the following code to populate the the NSTableView with my
custom cells:
EventCell *customEventCell = [[[EventCell alloc]
initWithEventAttributes:*TITLE VALUE GOES HERE*
eventStartTime:calItemStartDate eventEndTime:calItemEndDate]
autorelease];
[[eventTableView tableColumnWithIdentifier:@"events"]
setDataCell:customEventCell];
So here's my question:
1) How do I get the title value from my Events NSArrayController
Object? I've tried [eventTableView
valueForKey:@"Events.arrangedObjects.title"] and different variations
of it.
Thanks,
Christian
www.sippingbits.com
_______________________________________________
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