sortDiscriptor binding
sortDiscriptor binding
- Subject: sortDiscriptor binding
- From: Kevin Bracey <email@hidden>
- Date: Fri, 6 Oct 2006 14:59:11 +1300
Hi Guys,
This is a binding question, here's the situation...
... MyDocument
- (void)windowControllerDidLoadNib:(NSWindowController *)
windowController
...
NSSortDescriptor *orderDescriptor;
orderDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"order"
ascending:NO] autorelease];
sortOrder = [[NSArray arrayWithObject:orderDescriptor] retain];
...
in the NSArrayController Bindings sortDiscriptors
bindings File's Owner (MyDocument)
Model Key Path sortOrder
This is tricky to explain. When I set the sortDiscriptor directly
with setSortDiscriptor using an IBOutlet to the NSArrayController, it
sets the sort order in the tableview. Just as required.
But when I use bindings it doesn't seem to set it, but when you
change the order by clicking on the column header it changes the
sortOrder Array. So the binding is connected.
The question seems to be...
Why doesn't the sortDiscriptor get it's initial setting from the
binding link to MyDocument when it gets setup?
or am I going about this the wrong way...
Cheers
Kevin
_______________________________________________
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