• 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: Some Cocoa Objective-C problems - please help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some Cocoa Objective-C problems - please help


  • Subject: Re: Some Cocoa Objective-C problems - please help
  • From: j o a r <email@hidden>
  • Date: Thu, 26 Jun 2003 08:17:28 -0700

On Thursday, Jun 26, 2003, at 07:53 US/Pacific, Poornima Ranganath wrote:

1]with Toolbar.

I have toolbar with 6 items in it of which two are
disabled/enabled on some condition. I need to query
ONLY these two toolbar items for their state [If the
item is Enabled or Disabled] on click of a Button. How
do i query only these two toolbar items on click of a
button?. I know of the method - toolbarItem
"isEnabled".But how do i get a pointers to only these
two items and query them "isEnabled" on click of a
button.?

You should not have to do this. Think about the MVC design pattern, your view (the toolbar) should only reflect what you already know from the model layer of your application, ie. you should know the state of the toolbar without having to look at the toolbar item.
That said, as you point out, there is no "toolbarItemForToolbarItemIdentifier:" method in NSToolbar, but you can make one yourself fairly easily if you iterate over the items returned via the "items" method.

j o a r
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Some Cocoa Objective-C problems - please help
      • From: Matt Gemmell <email@hidden>
References: 
 >Some Cocoa Objective-C problems - please help (From: Poornima Ranganath <email@hidden>)

  • Prev by Date: Some Cocoa Objective-C problems - please help
  • Next by Date: Re: Some Cocoa Objective-C problems - please help
  • Previous by thread: Some Cocoa Objective-C problems - please help
  • Next by thread: Re: Some Cocoa Objective-C problems - please help
  • Index(es):
    • Date
    • Thread