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

  • Home
  • SEARCH
  • 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 4025492
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:51:13+00:00 2026-05-20T10:51:13+00:00

I have a Cocoa app I’m working on and I get a different result

  • 0

I have a Cocoa app I’m working on and I get a different result in appearance for the NSToolbar I am using for the main window.

Specifically, I’m using a search field as the last NSToolbarItem and, whereas under Snow Leopard it is displayed correctly:
enter image description here

it is cut under Leopard:
enter image description here

Looking at those two versions it appears that the spaces I put between the items are not respected under Leopard. I also saw that sometimes, after I make some update at the toolbar in Interface Builder, these changes are not mirrored in the running application even under Snow. I have to drag the default bar from the customizing menu in order to see them.

UPDATE
The reason for the NSToolbar not always mirroring what is in the .nib file resides in the autosave mechanism that was enabled for me, as NSGod suggested.

What can be the cause of this misbehavior?
Is there something about constraints, (minimum and maximum) sizes that I should have taken into account?
Feel free to point some documentation to me

UPDATE 2
Is there a way to programmatically introduce item and spaces into a NSToolbar or check the consistency (at run time) of those entered with Interface Builder?

  • 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-20T10:51:13+00:00Added an answer on May 20, 2026 at 10:51 am

    While I do recall having a couple of oddities with search fields in NSToolbars, I’ve never seen the behavior where the right side of it is cut off.

    Are the NSToolbarItems that are spaces the fixed one-unit space, or the flexible spaces?

    “I also saw that sometimes, after I
    make some update at the toolbar in
    Interface Builder, these changes are
    not mirrored in the running
    application even under Snow. I have to
    drag the default bar from the
    customizing menu in order to see them.”

    You need to keep in mind that if you’ve enabled user customization and autosave behavior in the toolbar, then when the user explicitly makes a change, it will be saved to user defaults. If you then re-arrange your toolbar in IB and run the app, it’s possible that the configuration saved in user defaults is overriding the default configuration you’ve specified in the nib file.

    What I usually do is during testing, delete the prefs file for my app so changes can’t be overridden. (FWIW, I usually use an AppleScript saved as an application that I keep in my Dock. It just runs a do shell script command which deletes the prefs file. Being a GUI-oriented type of person, it’s easier for me to just click it to have it run right before debugging. This version of the script asks for the prefs file to delete, though it can also be customized: http://www.markdouma.com/developer/DeleteAppPrefs.zip. If you’ve never run it before, you get the choose file dialog, and the chosen file is saved as an alias inside the actual AppleScript, so you’re not asked again. You can drag the icon onto AppleScript Editor to take a look at the script or change it).

    Anyway, then, if I’m going to release a new version of an app that uses a new toolbar layout, and want to prevent the config from being overridden, I’ll change the toolbar’s identifier (or autosave name) to something like “docToolbar2.0”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm adding repeating events to a Cocoa app I'm working on. I have repeat
I have a Cocoa app that uses a WebView to display an HTML interface.
I have a cocoa app with two types windows each of which requires a
I have a Cocoa app I'm writing that has an ImageView with a TextView
Many classes in Cocoa/Cocoa Touch have the NS prefix. What does it mean?
I'm learning objective-C and Cocoa and have come across this statement: The Cocoa frameworks
I have just discovered the nifty unhandled exception handler for cocoa-touch. Now that I
I have two projects, a Cocoa iPhone application and a static library which it
I'm just beginning to have a look at Objective-C and Cocoa with a view
Have just started using Google Chrome , and noticed in parts of our site,

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.