Questions tagged [nsstoryboard]

A storyboard encapsulates the design-time view controller and window controller graph represented in an Interface Builder storyboard resource file. It is a new technology for OSX, inherited from iOS, introduce in OSX 10.10.

38 questions
12
votes
3 answers

Why can't I connect my menu to my view controller IBAction?

I have a document based application. I have just created menu items in the storyboard and IBActions in my view controller. However the usual way I connect an action to a target doesn't work -(IBAction) markAsHidden:(id)sender; -(IBAction)…
Thomas
  • 8,306
  • 8
  • 53
  • 92
10
votes
5 answers

OS X storyboard calls viewDidLoad before applicationDidFinishLaunching

I created a Mac OS X application in Xcode using storyboards. For some reason the applicationDidFinishLaunching method in the AppDelegate is being called after viewDidLoad in the NSViewControllers. As with iOS apps, I thought viewDidLoad is supposed…
wigging
  • 8,492
  • 12
  • 75
  • 117
9
votes
1 answer

Storyboard doesn't contain a controller with identifier 'MainWindow'

I am trying to instantiate an NSWindowController from a storyboard in my OS X app: NSWindowController *mainWindowController = [[NSStoryboard storyboardWithName:@"Main" bundle:nil] instantiateControllerWithIdentifier:@"MainWindow"]; But this is what…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
6
votes
0 answers

Present a View Controller Programmatically OS X

so maybe this is so easy and I'm being dense but.. I'm trying to open a view controller that is displayed on my main.storyboard programatically from my MenuBarController. The View Controller doesn't have any segues attached to it but I have given…
Jimmy Jam
  • 107
  • 1
  • 6
5
votes
3 answers

Dismiss ViewController does not deallocate memory

I'm having a memory-related issue, that is, whenever I go(segue) to a second view and then go back (dismiss), the memory keeps stacking up. I have the following code in my second viewController. However, it does not deallocate memory. override…
Willjay
  • 6,381
  • 4
  • 33
  • 58
5
votes
0 answers

How do I use NSPageController on storyboard?

On the storyboard when I try to add a NSPageController, it comes out with it's own view. When I want to use a split view i can add a NSSplitViewController or just a split view. I prefer to use the SplitView inside a NSViewController. Is there…
Carlos Farini
  • 123
  • 2
  • 8
3
votes
1 answer

How to make two windows pop out in the beginning on a Swift 4 Cocoa application?

I'm working on a Swift 4 Cocoa Mac OS X (not iOS) project with XCode 9. I have two NSWindows in my main storyboard with different (subclasses of) NSViews. Currently only one window holds the storyboard entry point and so the other one does not…
Jineon Baek
  • 133
  • 3
3
votes
2 answers

What is the correct way to make a NSWindowController Singleton in Swift?

I have a sample project as: https://github.com/ericgorr/nspanel_show.git My project is a storyboard, document based application. I would like to use a custom segue to toggle the visible state of the inspector window. What I have should work, but I…
ericg
  • 8,413
  • 9
  • 43
  • 77
3
votes
1 answer

OSX / macOS - how to migrate a xib to the storyboard

I have an app with a mainmenu.xib and for various reasons I want to migrate it to a storyboard. Is there a way to do this without creating a new project?
Vivek Gani
  • 1,283
  • 14
  • 28
2
votes
1 answer

Casting failure with a view controller instantiated from a storyboard

I have a view controller that instantiates a new window controller. I need to pass an object to that window controller's view controller. Here is what I have so far: let storyboard = NSStoryboard(name: "Main", bundle: nil) if let windowController =…
David Patterson
  • 1,780
  • 3
  • 17
  • 40
2
votes
1 answer

why does NSApplication sharedApplication mainMenu return nil?

Apple's docs say: All of an application’s menus in the menu bar are owned by one NSMenu instance that’s created by the application when it starts up. You can retrieve this main menu with the NSApplication method mainMenu. I have the following…
dev4life
  • 10,785
  • 6
  • 60
  • 73
2
votes
2 answers

activateIgnoringOtherApps and makeKeyAndOrderFront not working after NSWindow is closed

I started with a storyboard project. and I put Menubar item. When the menubar item is clicked, the following method is triggered in AppDelegate.swift. func setWindowVisible() { NSApp.activateIgnoringOtherApps(ture) …
Kyle KIM
  • 1,384
  • 2
  • 15
  • 31
2
votes
3 answers

Document-Based App autosave with storyboards

In Document-Based Apps, using XIB files, when a new window is created its behaviour is: Be positioned and sized based on the position of the last active window. If the last active window is still visible then the new window should be cascaded…
catlan
  • 25,100
  • 8
  • 67
  • 78
2
votes
1 answer

NSSearchField and NSSegmentedControl inside an NSToolbar

The setup: I'm writing an document-based app targeting OS X 10.11 using storyboards. The main window has an NSToolbar with a 3-segment NSSegmentedControl. When the segmented control is clicked, it should toggle the collapsed state of an…
Andrew
  • 7,630
  • 3
  • 42
  • 51
2
votes
2 answers

Mac OSX Storyboard : communicate between NSViewController

I use storyboard in a OS X cocoa application project with a SplitView controller and 2 others view controller LeftViewController and RightViewController. In the LeftViewController i have a tableView that display an array of name. The datasource and…
Elfoiros
  • 468
  • 1
  • 7
  • 18
1
2 3