Re: menu enabling/disabling in Java
Re: menu enabling/disabling in Java
- Subject: Re: menu enabling/disabling in Java
- From: Henri Lamiraux <email@hidden>
- Date: Mon, 23 Jul 2001 13:53:28 -0700
You should not be comparing the menu title in the first place
(localization!!!). You need to compare the action associated with a menu
item.
SEL action = [menuItem action];
if (action == @selector(addFile:))
return YES;
else
return NO;
On Monday, July 23, 2001, at 11:40 AM, Brian Webster wrote:
>
The reason that this isn't working is because you are comparing two
>
string objects to see if they're the same _object_, instead of
>
comparing to see if they hold the same string contents. You should use
>
menuItem.title().equals("Add File") instead.