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
3
votes
0 answers

NSTableCellView inside a custom view refuses first responder

Instead of a TableView I want to use a NSTableCellView inside a custom view. So I created a xib file with a standard NSTableCellView and loaded that into a view. The table cell view is displayed as expected. But I can't make its textfield the first…
user965972
  • 2,489
  • 2
  • 23
  • 39
3
votes
2 answers

Backward compatibility of Xcode OSX

How to use features such as viewDidLoad or appDidBecomeActive in Xcode 4.6.1 for OSX 10.8, which are available only for OSX 10.10 and above. Please suggest the alternative ways to use these functions.
3
votes
1 answer

How to Configure NSWindowController, NSViewController, and NSViews

To be honest, I don't even know where to start. I feel like I've been going around in circles for hours trying different things. My issues are around how to configure NSWindowControllers, NSViewControllers, and NSViews in IB and then access each in…
RichardRogers
  • 31
  • 1
  • 3
3
votes
2 answers

Binding selection across multiple view controllers in a single window interface

I am having an issue wrapping my head around how to hook up a few NSArrayControllers across two view controllers. I want to sync the selection in the source list table view to update the values in the second detail view controller. I'm using the…
3
votes
1 answer

view-based NSTableView's views from XIB?

Is it possible to have a separate XIB file for the NSTableCellView of a view-based NSTableView? Maybe with the help of a NSViewController?
bijan
  • 1,675
  • 18
  • 30
2
votes
1 answer

How to display a view from a NSViewController?

I'm new at objective-c so please bear with me. I have a class that returns a picture from a webcam and I am trying to display that to the screen. I subclassed NSViewController to get the image from the camera class and set it to an instance…
user1267383
  • 103
  • 1
  • 9
2
votes
1 answer

Load nib from other nibs (i.e. Interface Builder) in Cocoa

I have a view setup in Interface Builder which contains a viewController that loads another Nib file. However, for some reason the objects contained in the nib file being loaded never gets called awakeFromNib. What am I missing here? Is there anyway…
Tony
  • 36,591
  • 10
  • 48
  • 83
2
votes
0 answers

NSViewController subclass object is loaded, but its widgets are not loaded into its NSView

I have created a custom view that is intended to be loaded in some different windows. ActionWidgets is a subclass of NSViewController, complete with its own xib file and its own widget contents. In a window where it is used, I have created an object…
lpetrich
  • 31
  • 3
2
votes
1 answer

In Swift keyDown(with event: NSEvent) not working when collectionView is selectable

I have an NSCollectionView which lives inside an NSViewController. NSViewController overrides the following: class myViewController : NSViewController{ weak var collectionView : NSCollectionView! public override keyDown(with event:…
dmann200
  • 529
  • 4
  • 11
2
votes
2 answers

first mac app - push viewcontroller

I have a question, I do some iphone application and now I want to do a little mac application. From a clean application I add a button on MainMenu xib, than I add a NSViewController to MainMenu (from IB) with one Action. I create a new…
francesco.venica
  • 1,703
  • 2
  • 19
  • 54
2
votes
1 answer

Have a control selected in a loaded view

I have a question about using NSViewController and switching between views. I have a Cocoa application where I have a window. The idea with the window is that it will display a number of views one by one where each view is stored in a separate XIB…
2
votes
2 answers

Switching between NSViewControllers

I'm developing a Mac Application. The application has a common source view on the left and a detail view on the right which is the main part of the whole window. It's like a Master-Detail relationship, but each element in the source view require…
burki
  • 2,946
  • 6
  • 37
  • 51
2
votes
1 answer

NSWindowController object linkage in Interface builder

I created a NSWindow xib file that I want to open on click of a button in another window. Now, to control the behavior of the NSWindow, I dragged an object from Library in xib and changed it to subclass of NSWindowController (i.e.…
Ashok
  • 6,224
  • 2
  • 37
  • 55
2
votes
1 answer

How to animate the size change of an NSViewController presented as a sheet?

In Xcode, if you try to create a new file, it will ask you where to save it. There is this button that you can press to expand the sheet presented: I am trying to create something similar to that button, which will enlarge an NSViewController…
Sweeper
  • 213,210
  • 22
  • 193
  • 313
2
votes
2 answers

Swift MacOX - Popover segue creates multiple view controller instances without destroying them when they are dismissed

I'm creating a popover style view controller in storyboard like this Then I click the button, the view controller shows and when I click anywhere outside, the view controller is "dismissed". However, when I click the button again, a new instance of…
Fangming
  • 24,551
  • 6
  • 100
  • 90