Questions tagged [nsviewcontroller]

An Objective-C object that manages a view, typically loaded from a nib file.

The NSViewController object manages a view, typically loaded from a nib file.

This management includes:

  • Memory management of top-level objects similar to that of the NSWindowController class, taking the same care to prevent reference cycles when controls are bound to the nib file's owner that NSWindowController began taking in Mac OS v 10.4.
  • Declaring a generic representedObject property, to make it easy to establish bindings in the nib to an object that isn't yet known at nib-loading time or readily available to the code that's doing the nib loading.
  • Implementing the key-value binding NSEditor informal protocol, so that applications using NSViewController can easily make bound controls in the views commit or discard the changes the user is making.

For more information on the NSViewController object, check Apple's NSViewController Class Reference.

410 questions
0
votes
0 answers

Show NSViewController from NSWindow

The main window in my OS X app is based on a NSWindow. How do I show a popup view/window from a NSWindow? I tried the following: NSViewController* vc = [[NSViewController alloc] initWithNibName:@"DialogConfirm" bundle:nil]; [self…
0
votes
3 answers

How to pass value from NSViewController to custom NSView of NSPopover?

By using the delegation protocol I have tried to pass a string (inputFromUser.string) from NSViewController - mainController to custom subclass of NSView of NSPopover - PlasmidMapView, to drawRect function, see code below. But, it didn’t work. I…
VYT
  • 1,071
  • 19
  • 35
0
votes
2 answers

Print panel accessory view shows in OS X 10.11, but not in 10.10 and 10.9

My OS X app supports 10.9 - 10.11. I try to add some options to a printing operation by adding a print accessory view like this: MyPrintView *printView = [[MyPrintView alloc] initWithData: [self myData]]; NSPrintOperation *printOperation =…
MartinW
  • 4,966
  • 2
  • 24
  • 60
0
votes
1 answer

Resizing Nested NSViews

In order to categorize a wide variety of unique views, I have an elaborate setup: main categories are selected via a toolbar, and then specific panes are selected in a category's NSScrollView. This looks like: window -> NSViewController controlling…
spamguy
  • 1,575
  • 2
  • 17
  • 37
0
votes
1 answer

NSPopover animate contentViewController change and change popover size

I am making a NSPopover, and have made it so I can transition between view controllers with a sliding animation using a parent view controller with my view controllers as children. It works well, except before I added this, the popover automatically…
AppleBetas
  • 88
  • 6
0
votes
4 answers

Cocoa - Present NSViewController programmatically

Generally, We can able to display next view controller from first view controller by having different kind of NSStoryboardSeque like Present, Show, Sheet etc., But, How we can achieve the same programmatically?. Comparing with UIViewController,…
Shanmugaraja G
  • 2,778
  • 4
  • 31
  • 47
0
votes
2 answers

Navigate to different view controllers inside the same window

I created an OS X Cocoa Application in Xcode 7.2.1. I gave the default view controller on Main.storyboard a Storyboard ID of "view1". I added another view controller and gave it a Storyboard ID of "view2". I added a button to "view1" and linked the…
user1822824
  • 2,478
  • 6
  • 41
  • 65
0
votes
1 answer

How can I make an NSViewController topmost in Xcode?

I would like to know if there is a way to make one of my NSViewControllers stay on top of the rest of them in Xcode or Swift 2. I am also working with OS X Cocoa. Thanks!
TDM
  • 814
  • 2
  • 12
  • 21
0
votes
0 answers

cocoa doc based app MVC binds

Suppose there's an doc based app, class Document subclass from NSDocument and has a property of type NSArray. ViewController is the document's windowController's contentViewController, and has a NSArrayController. then how to bind the…
0
votes
0 answers

Open Window for asking for Password to store in keychain in Swift 2.0

i tried a much, but it doesn't work :-( I have written a class with a part is this: if useKeychain { let server : String = "smb://cloud.amrhein.info" let user : String = "gerald" let pwd :…
0
votes
0 answers

How to replace AppDelegate window with a window from other controller?

I'm developing a MacOSX app and I don't know how to change the main window created by AppDelegate by another created by me in another ViewController. Actually I instantiate the viewController and set the main view to the AppDelegate window content…
0
votes
1 answer

NSViewController and custom views

So I have this layout. I need to load three views into it, the big view, which is part of the NSWindow. The sidebar view and the bottom view. I almost managed to do it but cant put my finger onto how to complete the process. I want those views to…
Dmitri K.
  • 197
  • 1
  • 13
0
votes
0 answers

OSX Showing Storyboard View Controller Programatically - Swift

So i have this app and on the first open i want it to show a quick start page. The code i have to initiate and work out if its there first open is let savedData = NSUserDefaults(suiteName: "xxx") if savedData?.boolForKey("firstTimeUser") ==…
Eli
  • 668
  • 2
  • 13
  • 37
0
votes
1 answer

Swift - NSMenu Item Popover doesnt get Focus

so ive run into a strange Problem, which is kinda hard to explain, but i will try. I have a Status Menu Item : let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-2) it contains a NSMenu : let menu = NSMenu() …
T1663R
  • 35
  • 5
0
votes
1 answer

Passing data between different NSViewController swift OS X

I need to pass data between two different NSViewController: class PrincipalView: NSViewController { var num = 10 override func viewDidLoad() { super.viewDidLoad() // Do view setup here. } fun getNum() -> (Int) { …
Geek20
  • 673
  • 1
  • 9
  • 18