• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
sortDiscriptor binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: sortDiscriptor binding
      • From: mmalc crawford <email@hidden>
  • Prev by Date: Re: Removing lists from an attributed string?
  • Next by Date: Re: NSKeyValueObservingOptionNew broken for NSArrayController: best practice workarounds?
  • Previous by thread: Re: Removing lists from an attributed string?
  • Next by thread: Re: sortDiscriptor binding
  • Index(es):
    • Date
    • Thread