• 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
NSTreeController selection (probably a silly mistake)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTreeController selection (probably a silly mistake)


  • Subject: NSTreeController selection (probably a silly mistake)
  • From: Derrek Leute <email@hidden>
  • Date: Mon, 9 Oct 2006 22:26:58 -0400


I am trying to access the currently selected object in an NSOutlineView who's content is bound to arrangedObjects of an NSTreeController.


The NSTreeController contentObject is bound to an object in MyDocument (through File's Owner) which has children and isLeaf accessors tied properly to the tree controller. This all works fine and my hierarchy shows up when I bind a column to displayName. Happy.

Now, I am trying to enable a button based on the bool value (actually NSNumber numberWithBool) returned from a "canAddNew" accessor of the selected object in the outline view. Interface Builder settings are:

Bind to: NSTreeController
Controller key: selection
Model Key Path: canAddNew

This doesn't work. I've been reading through documentation to see what obvious thing I'm missing but I just can't find it. During initialization of each object I send a setCanAddNew message. Logging shows that the variable has been set. However, my button never becomes enabled no matter what the Outline view selection is.

In fact, I can't get responses from selection from anything for any binding. (target,argument enabled, hidden for any controls). If I bind to a text fields value, it stays disabled with "No Selection" in it. Obviously I'm missing something. Could someone point me at the right model key path?

Thanks!

--Derrek

P.S. -- For a variety of reasons, I can't use the NSTreeController's implementation of canAdd. So I'm rolling my own.
_______________________________________________
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: NSTreeController selection (probably a silly mistake)
      • From: Felix Franz <email@hidden>
  • Prev by Date: Re: NSCalendarDate saving and loading to get the same date-time
  • Next by Date: Best practices : use array controller to insert objects into managed object context
  • Previous by thread: Re: Core Data - Transient getters called during save
  • Next by thread: Re: NSTreeController selection (probably a silly mistake)
  • Index(es):
    • Date
    • Thread