Re: Calling IB Actions In PB
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.