• 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: how to validate toolbar with different target?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to validate toolbar with different target?


  • Subject: Re: how to validate toolbar with different target?
  • From: "I. Savant" <email@hidden>
  • Date: Sat, 11 Nov 2006 16:15:53 -0500


Why not bind the buttons' "enabled" to the array controller's canAdd and canRemove keys?


--
I.S.


On Nov 11, 2006, at 4:12 PM, Marc Respass wrote:

Hi,

I have some buttons in my window's toolbar that are bound to an NSArrayController (selectNext, selectPrevious, add, remove, etc). This is a non-document based CoreData app. My AppDelegate is also the window (with the toolbar) delegate and I implement

-(BOOL)validateToolbarItem:(NSToolbarItem *)toolbarItem

which works fine for the Save button because the Save button's target is the app delegate but it doesn't get called for any of the buttons whose target is the array controller. This leads me to think that toolbar validation is sent to the target of the toolbaritem. Is that correct? If so, I expect that I will need to subclass NSArrayController and put the validation there. What would be cool is subclassing NSArrayController, adding a delegate, and somehow forwarding the message. Or maybe I can just forward some messages to the NSArrayController. This is not something I've ever done but I remember hearing people talk about message forwarding in Cocoa and WebObjects.

Any tips are appreciated.

Thanks
Marc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


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
References: 
 >how to validate toolbar with different target? (From: Marc Respass <email@hidden>)

  • Prev by Date: launchd agents
  • Next by Date: NSSlider with 2 sliders
  • Previous by thread: how to validate toolbar with different target?
  • Next by thread: Re: how to validate toolbar with different target?
  • Index(es):
    • Date
    • Thread