NSWindows' toolbar button not work - xcode

I'm building a Mac OS X app.
I just tried to set a toolbar button to show/hide a toolbar on NSWindow's title bar. But it doesn't do anything for me.
Initially I tried to achieve that with the checkbox in the interface builder.
Toolbar button I expected here is below.
I tried the checkbox in the interface builder to get the button like below.
I thought it could be no longer available in the latest El Capitan, then tried it with Xcode 4.6 on Lion but I could not see the button, neither.
I found the following page to explain how to add a button to the title bar on this site.
How to use NSTitlebarAccessoryViewController?
And I could manage to do that by myself.
But I'm still wondering if there is a way to use the default button.
Any suggestions would be appreciated.

I am pretty sure Apple dropped the toolbar button with OS X Lion. I assume the checkbox is only there for older versions. (Snow Leopard and earlier)
Adding your own button using NSTitlebarAccessoryViewController is a good idea!

Related

SwiftUI: The Structured Editing Popover (Command + Click) does not show up

In SwiftUI tutorial (link) it says to:
Command-click the text view’s initializer to show the structured editing popover, and then choose Embed in VStack
However, it does not work for me.
What is the command for that?
What that deprecated already?
If it helps someone out there, you must have changed Xcode shortcut preferences to go to "Definition" on "Command Click".
So now for seeing the structured editing popover, use "Control Command Click".
Seems to be an Xcode quirk caused by having the canvas hidden. Bring the preview canvas back on screen and the Command + Click functionality returns to normal:
I've seen similar weirdness with two Xcode windows open… especially if one window is hiding the Preview.
Another quirk mentioned above: the Library picker is missing the Views and Modifiers tab sometimes. Again, open the Preview Canvas and the Library will snap back to normal. You might also have to bring focus to the canvas (i.e. click on something there).
Close and reopen Xcode should help. Like code completion sometimes is not working the popover also sometimes stuck.
I found that command + Left Click on Text (within the .swift file) took me to the definition of Text, however command + Right Click caused the menu containing "everything" to appear, from which I was then able to select "Show in UISwift inspector".
I couldn't get anything to popup in the Canvas.
Using Xcode 12.2 on macOS 11.0.1
According to Apple's release notes for the latest Xcode 11 beta release, the inspector and preview features don't currently work without MacOS Catalina 10.15 (the current stable/public release is MacOS 10.14.6 at the time of posting).
You'll either need to wait until the publicly released version of Mac OS 10.15 or gain access to a beta version of MacOS to use these.
Source (Apple | Xcode 11 Release notes):
Xcode 11 supports development with SwiftUI. (22843503)
Note: SwiftUI previews and inspectors are only available when running on macOS Catalina 10.15.
Restart the project for 1 or 2 times and CMD+B(Build) your project one the start.

Xcode 7.3 transition alway modal

I have an app that runs fine inside of Xcode 6.3 that is running on MacOS X 10.5. When I copied this same program code to another Mac machine that is running EL Capitan v. 10.11.5 and Xcode 7.3.1, prepareForSegue will display a modal transition versus its configured "Show (e.g. Push)"!
I deleted the UINavigationController, and then reinstituted it by "embedding" it via the tableViewController. I also reestablished the "Show (e.g. Push)" Storyboard Segue Kind between the initial view controller, and the UINavigationController. Unfortunately, the transition is alway a Modal segue (the tableviewController opens from the bottom of the screen).
Please help me with this issue! Any suggestions would be greatly appreciated! Thank you

Blank NSComboBox on OS X Yosemite

I have a set of NSComboBox elements shown within the toolbar of an NSPanel, all created with XCode/Interface Builder. When I click on them on Yosemite, all I can see is a black box where the combo box items should be. On earlier versions of OS X this works just fine. No exceptions are logged at all. Here's a screen capture:
Any idea of what could be broken? I can't see any relevant release notes from Apple.
Bypassed this by using a NSPopup instead.

mac toolbar style

Does anybody know how to make a toolbar which style is like top bar of "Xcode Organizer"?
Press different item ,different view will show down below.
It has toolbar style but tab bar function,Many mac apps' preference pane use it,I'm confused.
Can anybody help me please.
Thank you very much.
Plus this is a Mac Application
Start with the documentation for NSToolbar. There are even some sample applications to get started with.
Good overview for making a better preferences window - see the link to a demo project on the second page of this article.

IKImageBrowserView images won't show in OS X 10.5

The Apple Demo IKImageViewDemo does not seem to work correctly in 10.5.
The control is there, but there are no visible images. The images are there because when you click and drag where an image is supposed to be, the ghost of the image appears and drags.
Is there an alternative to using the IKImageBrowserView for users on Leopard 10.5-10.5.8, or is there an alternative "gallery" style control?
Anything I need to do special in Interface Builder? Any option that needs to be / not be checked?
IKImageBrowserView is available in OSX 10.5 and later:
http://developer.apple.com/library/mac/#documentation/GraphicsImaging/Reference/IKImageBrowserView/IKImageBrowserView_Reference.html
Sample projects that work on OSX 10.5:
http://developer.apple.com/library/mac/#samplecode/ImageBrowser/Introduction/Intro.html
http://developer.apple.com/library/mac/#samplecode/IKImageBrowserViewWithCoreData/Introduction/Intro.html

Resources