• 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: Bindings Sample code / Suggested reading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings Sample code / Suggested reading


  • Subject: Re: Bindings Sample code / Suggested reading
  • From: Brian Smith <email@hidden>
  • Date: Thu, 4 Aug 2005 09:58:46 +0800

Try looking at the graphics example from ( and some of the other examples ),
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html


Like this example, I expose the selection indexes and the controller for them in the view. My inspector panel's window controller then observes NSWindowDidBecomeMainNotification and once the main window changes programally switches the bindings of the inspector to the new main window view's selection controller. I'm not sure if this is a better way to do this but it works. Doesn't the NSTreeController for the document class handle selections, not the document class? This sounds odd that you bind to your document class for this.

Brian

On Aug 4, 2005, at 1:00 AM, Glen Simmons wrote:

I'm having an issue with NSTreeController's selectionIndexPaths binding. I'm trying to bind controls in an inspector panel to the current document's selection. I've bound the NSTreeController's contentObject to Shared Application.mainWindow.windowController.document.rootObject and the selectionIndexPaths to Shared Application.mainWindow.windowController.document.selectionIndexPaths. My document class has the correct accessors and when the selection changes, I call setSelectionIndexPaths in my document and the bindings update and everything is great. That is, until the document loses focus or I switch documents. Then my document's setSelectionIndexPaths method gets called by the binding system with an empty array, so the selection is wrong. Why is it doing that and how do I make it stop?

Thanks,
Glen

_______________________________________________
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



_______________________________________________ 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: Bindings Sample code / Suggested reading
      • From: Glen Simmons <email@hidden>
References: 
 >Bindings Sample code / Suggested reading (From: Glen Simmons <email@hidden>)

  • Prev by Date: Re: NSImage or NSBezierPath : what is the fastest ?
  • Next by Date: Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
  • Previous by thread: Bindings Sample code / Suggested reading
  • Next by thread: Re: Bindings Sample code / Suggested reading
  • Index(es):
    • Date
    • Thread