• 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: Calling IB Actions In PB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling IB Actions In PB


  • Subject: Re: Calling IB Actions In PB
  • From: Andy Lee <email@hidden>
  • Date: Sat, 13 Apr 2002 13:39:42 -0400

At 12:01 PM -0500 4/13/02, Albert Atkinson wrote:
How do I call common actions in IB using PB? For example I would like to use the toggleDrawer: action but since I am using a toolbar I need to hard code it so is there any way I can make reference to toggleDrawer: ?

If I understand correctly, you are asking how to refer to the -toggleDrawer: action in Objective-C code as opposed to making the connection graphically in Interface Builder.

Here's how:

[myToolbarItem setAction:@selector(toggleDrawer:)];

The @selector() directive lets you refer to method names. An action is just a method. Note that the colons in method names are significant, so don't make the following easy-to-make typo:

[myToolbarItem setAction:@selector(toggleDrawer)]; // WRONG

--Andy
_______________________________________________
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: Calling IB Actions In PB
      • From: Albert Atkinson <email@hidden>
References: 
 >Calling IB Actions In PB (From: Albert Atkinson <email@hidden>)

  • Prev by Date: Re: Undo in tables
  • Next by Date: Java Bridge problem
  • Previous by thread: Calling IB Actions In PB
  • Next by thread: Re: Calling IB Actions In PB
  • Index(es):
    • Date
    • Thread