• 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
validateUserInterfaceItem problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: validateUserInterfaceItem problem
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: please help with this handler issue
  • Next by Date: Re: validateUserInterfaceItem problem
  • Previous by thread: Re: please help with this handler issue
  • Next by thread: Re: validateUserInterfaceItem problem
  • Index(es):
    • Date
    • Thread