Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > New Action for First Responder

New Action for First Responder
Thread Tools
Fresh-Faced Recruit
Join Date: Feb 2006
Status: Offline
Reply With Quote
Feb 14, 2006, 07:57 AM
 
Hi, I'm very new to Mac programming and this is my first hair-pulling problem.. So please help

I created a cocoa document-based application in Xcode, and opened MainMenu.nib in IB. I want to add a new menu item, say, "show drawer", that sends showDrawer: action to FirstResponder. However, IB has a fixed list of messages understood by First Responder, from which I must pick one. How do I add showDrawer: action to the Target/Action pane of First Responder?

Thanks very much!
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Feb 16, 2006, 05:33 AM
 
I may be wrong, but I would think you don't want to tie the action to First Responder, but rather create a new IBAction and tie that to your menu item. You can add the new action either in the header file or directly in Interface Builder.
     
Fresh-Faced Recruit
Join Date: Feb 2006
Status: Offline
Reply With Quote
Feb 16, 2006, 05:38 AM
 
Hi, thanx for your reply. I managed to solve the problem

Turns out that I just need to double click "First Responder" icon in IB and then I can add new Action to it in the info window. I had to use "First Responder" because it's a multi-document application and I can't tell before-hand which document is going to respond to the message.

     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Feb 16, 2006, 07:05 PM
 
Glad you got it figured out, having not really worked with doc-based apps I couldn't figure out tying such actions to First Responder.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:29 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2