• 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 add items with actions to the main menu
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to add items with actions to the main menu


  • Subject: Re: How to add items with actions to the main menu
  • From: Lynn Barton <email@hidden>
  • Date: Sun, 27 Jul 2008 21:21:16 -0700
  • Thread-topic: How to add items with actions to the main menu

Title: Re: How to add items with actions to the main menu
Thanks, Kevin; that worked, up to a point. (I use Xcode 3.0 with NIBs, not XIBs.) My new menu item is disabled, even though the enabled box in the inspector is checked.
Lynn Barton


On 7/22/08 9:31 AM, "Kevin Cathey" <email@hidden> wrote:

Lynn,

You would add the menu item in your MainMenu XIB file. In the same file, add an action to First Responder with the name of your action (e.g. importDataFromTextFile: or something). Then, connect the new menu item to First Responder. In any class in your responder chain, though most likely and most encouraged in the window controller, you would implement your importDataFromTextFile: method.

Does that make sense?

Kevin

 
--------------------------
Kevin Cathey



On Jul 21, 2008, at 8:59 PM, Lynn Barton wrote:

I am building a core data document-based application very similar to the one in the NSPersistentDocumentTutorial. I want to make some changes to the Main Menu. I want to insert a new menu item (easy enough) for importing data from a text file. How do I define the action message and its target? Where should I put the code to respond to that message and import the data?
   _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users 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.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: How to add items with actions to the main menu (From: Kevin Cathey <email@hidden>)

  • Prev by Date: Can't debug unit test
  • Next by Date: Re: Open Quickly vs Subversion
  • Previous by thread: Re: How to add items with actions to the main menu
  • Next by thread: Problems attaching debugger
  • Index(es):
    • Date
    • Thread