validateUserInterfaceItem problem
validateUserInterfaceItem problem
- Subject: validateUserInterfaceItem problem
- From: Pax <email@hidden>
- Date: Thu, 29 Aug 2013 13:38:21 +0100
I've written some code to enable / disable the menu items of my NSDocument based application, as appropriate. It works for methods that I've written myself, but not (apparently) for ones that are provided for me.
Here's the code (simplified slightly just to say return 'NO' - a quick test to see if what I'm doing works):
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem
{
SEL theAction = [anItem action];
if (theAction == @selector(toggleFormat:))
{
return NO;
}
if (theAction == @selector(toggleToolbarShown:))
{
return NO;
}
if (theAction == @selector(runToolbarCustomizationPalette:))
{
return NO;
}
if (theAction == @selector(previewData:))
{
return NO;
}
return [super validateUserInterfaceItem:anItem];
}
The question is - what am I doing wrong? Why don't toggleToolbarShown or runToolbarCustomizationPalette get validated? How would you suggest that I fix this?
Regards,
Pax
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden