• 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
Re: outlineViewSelectionDidChange not called
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: outlineViewSelectionDidChange not called


  • Subject: Re: outlineViewSelectionDidChange not called
  • From: "Hamish Allan" <email@hidden>
  • Date: Thu, 27 Mar 2008 19:07:06 +0000

On Thu, Mar 27, 2008 at 5:17 PM, Adam Gerson <email@hidden> wrote:

>  Ok, I understand. So I bind both the OutlineView and the
>  TreeController to a third object that keeps them both in sync to the
>  same SelectionIndexPath value.

No -- you bind the view to the controller and the controller to the model.

>  However, when I tried this my
>  OutlineView was blank. I think the Outline Views's selectionIndexPaths
>  binding refers to the selectionIndexPaths of its content provider (in
>  this case the tree controller). I dont think and outline view has
>  selectionIndexPaths properties of its own.

If your outline view is blank there is a problem with your
content/value bindings; this is a separate issue to the selection
index path bindings.

Basically, you need the following bindings (assuming you have
NSMutableArray properties called "content" and "selectionIndexPaths"
in your File's Owner):

(View to Controller bindings:)
NSOutlineView's Content to NSTreeController's arrangedObjects.
NSOutlineView's Selection Index Paths to NSTreeController's selectionIndexPaths
NSTableColumn's Value to NSTreeController's arrangedObjects.nodeName

(Controller to Model bindings:)
NSTreeController's Content Array to File's Owner's content
NSTreeController's Selection Index Paths to File's Owner's selectionIndexPaths

Then, if you need to "update some non controller bound GUI controls
when the selection changes", you need your secondary controller (well,
it's neither model nor view, is it?!) to observe your File's Owner's
selectionIndexPaths (using addObserver:forKeyPath:options:context:)
and update the controls accordingly.

Best wishes,
Hamish
_______________________________________________

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

  • Follow-Ups:
    • Re: outlineViewSelectionDidChange not called
      • From: "Adam Gerson" <email@hidden>
References: 
 >outlineViewSelectionDidChange not called (From: "Adam Gerson" <email@hidden>)
 >Re: outlineViewSelectionDidChange not called (From: Jens Alfke <email@hidden>)
 >Re: outlineViewSelectionDidChange not called (From: "Adam Gerson" <email@hidden>)
 >Re: outlineViewSelectionDidChange not called (From: Jonathan Dann <email@hidden>)
 >Re: outlineViewSelectionDidChange not called (From: "Adam Gerson" <email@hidden>)
 >Re: outlineViewSelectionDidChange not called (From: "Adam Gerson" <email@hidden>)
 >Re: outlineViewSelectionDidChange not called (From: "Adam Gerson" <email@hidden>)

  • Prev by Date: setMenuVisible
  • Next by Date: Re: NSToolbar doesn't add default items issue on 10.5.2
  • Previous by thread: Re: outlineViewSelectionDidChange not called
  • Next by thread: Re: outlineViewSelectionDidChange not called
  • Index(es):
    • Date
    • Thread