Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6156423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:36:28+00:00 2026-05-23T20:36:28+00:00

I have an application that will be available across multiple versions of OS X.

  • 0

I have an application that will be available across multiple versions of OS X. What’s the best way to make an NSToolbarItem only available to users in certain OS versions. When it is not available, it should be completely hidden, not just disabled.

To simplify, how do I remove a toolbar item from this (below) menu programmatically?

Toolbar Customization

Edit: I tried to override toolbarAllowedItemIdentifiers: in the delegate like so:

- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar *)toolbar {
    NSLog(@"Toolbar requesting allowed items.");
    NSMutableArray *array = [NSMutableArray array];
    [array addObject:@"TPUpToolbarItem"];
    [array addObject:@"TPDownToolbarItem"];
    [array addObject:@"TPResetToolbarItem"];
    [array addObject:@"TPSpeedToolbarItem"];
    [array addObject:@"TPGroupToolbarItem"];
    [array addObject:@"TPBackgroundToolbarItem"];
    [array addObject:NSToolbarShowFontsItemIdentifier];
    if (floor(NSAppKitVersionNumber) <= 1038) {
        NSLog(@"Below Lion, adding Fullscreen item.");
        [array addObject:@"TPFSToolbarItem"];
    }
    [array addObject:@"TPFlipHToolbarItem"];
    [array addObject:@"TPFlipVToolbarItem"];
    [array addObject:NSToolbarFlexibleSpaceItemIdentifier];
    [array addObject:NSToolbarSpaceItemIdentifier];
    [array addObject:NSToolbarSeparatorItemIdentifier];
    [array addObject:NSToolbarShowColorsItemIdentifier];
    [array addObject:NSToolbarPrintItemIdentifier];
    return array;
}

All the other toolbar items show in the correct order, however the Fullscreen item is last, and still there.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:36:29+00:00Added an answer on May 23, 2026 at 8:36 pm

    @NSGod was almost there. While the rest of his code works, it appears IB is overriding my code and adding in the Fullscreen button anyway. I had to move the toolbar item out of the toolbar and then manually point the NSToolbarDelegate to it by adding this method: (up, down, etc. are IBOutlets)

    - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag {
        if ([itemIdentifier isEqualToString:@"TPUpToolbarItem"]) {
            return up;
        }
        if ([itemIdentifier isEqualToString:@"TPDownToolbarItem"]) {
            return down;
        }
    
        if ([itemIdentifier isEqualToString:@"TPResetToolbarItem"]) {
            return reset;
        }
        if ([itemIdentifier isEqualToString:NSToolbarShowColorsItemIdentifier]) {
            return colors;
        }
        if ([itemIdentifier isEqualToString:NSToolbarShowFontsItemIdentifier]) {
            return fonts;
        }
        if ([itemIdentifier isEqualToString:NSToolbarPrintItemIdentifier]) {
            return print;
        }
        if ([itemIdentifier isEqualToString:@"TPSpeedToolbarItem"]) {
            return speed;
        }
        if ([itemIdentifier isEqualToString:@"TPBackgroundToolbarItem"]) {
            return background;
        }
        if ([itemIdentifier isEqualToString:@"TPGroupToolbarItem"]) {
            return group;
        }
        if ([itemIdentifier isEqualToString:NSToolbarFlexibleSpaceItemIdentifier]) {
            return flex;
        }
        if ([itemIdentifier isEqualToString:NSToolbarSpaceItemIdentifier]) {
            return space;
        }
        if ([itemIdentifier isEqualToString:@"TPFlipHToolbarItem"]) {
            return flipH;
        }
        if ([itemIdentifier isEqualToString:@"TPFlipVToolbarItem"]) {
            return flipV;
        }
        if ([itemIdentifier isEqualToString:NSToolbarSeparatorItemIdentifier]) {
            return sep;
        }
        if ([itemIdentifier isEqualToString:@"TPFSToolbarItem"]) {
            return fsItem;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an application that will capture different images from users and make them
I have an application that will mail users attachments of text files. Receiving users
I have a Flex 3.5 application that will serve multiple purposes, and as part
I'm writing a Java application that will have an on-screen number pad available for
I have an application that will support multiple sites. The site will be determined
I have an application that will initially be downloaded and installed by the user.
I have an application that will accept URLs from the built in web browser
I have this application that will recurse all folders in a given directory and
I have an application that will return JSON-P data, and I have been communicating
I have an application that requires resizing of a component that will be scaled

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.