Menu Target-Action Send Null Sender?

12 views
Skip to first unread message

Keary Suska

unread,
Nov 18, 2008, 8:26:30 PM11/18/08
to objec...@googlegroups.com
I have menu items defined:

[menu addItemWithTitle:@"Exercise" action:@selector(editTable:)
keyEquivalent:@"1"];
[menu addItemWithTitle:@"Equipment" action:@selector(editTable:)
keyEquivalent:@"2"];

Etc.

In -editTable: I put a log message:
CPLog.debug( "Selected table '" + [sender title] + "'" );

But I always get "null". It seems that the sender is null, so I added:

if( sender == nil ) CPLog( @"Sender is null!" );

And the message "Sender is null!" appears every time. Is there
something wrong with menu item actions, or do I need to do something
different?

I also tried to create each menu item individually and set the target
manually (the above code is using the nil-targeted mechanism), but
that didn't work either.

TIA,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

Francisco Tolmasky

unread,
Nov 19, 2008, 7:07:32 AM11/19/08
to Cappuccino & Objective-J
Reply all
Reply to author
Forward
0 new messages