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

How to have a NSViewController who's view's content depends on the way it's initialized?

This is actually a two part question, hope my explanation is clear: I have an NSViewController which can be configured to show a different custom view on part of its view. For example, its view can show either CustomViewA or a CustomViewB. I was…
Gabriel Ayuso
  • 207
  • 3
  • 13
2
votes
3 answers

How to change content view of Window?

I am developing an mac osx application which have initial window and viewcontroller launched from main storyboard. I want to replace the content view loaded by storyboard with my view. I am doing this - func replaceContentView() { …
Abhishek
  • 852
  • 9
  • 24
2
votes
2 answers

Add completion handler to presentViewControllerAsSheet(NSViewController)?

I am attempting to present a sheet configuration view (AddSoundEffect) for my main window/view controller (I'm using storyboards), and when the configuration view controller is dismissed, take the values entered in the AddSoundEffect view and pass…
Matt
  • 2,576
  • 6
  • 34
  • 52
2
votes
1 answer

How to call IKImageBrowser cellWasDoubleClickedAtIndex by pressing double keys?

I had used IKImageBrowserView to show image gallery. Currently opening next view on click on image, I am using double click of left mouse key to call cellWasDoubleClickedAtIndex this method. -(void)imageBrowser:(IKImageBrowserView *)aBrowser…
Solid Soft
  • 1,872
  • 2
  • 25
  • 55
2
votes
0 answers

Mac menu item grayed out even though first responder responds to the corresponding selector

I have a refresh item in my menu, bound to first responder's reload: method. I have two view controllers. Both DO implement the exact same method with the same signature: -(void)reload:(id)sth{ ... } The menu item is bound the following…
Can Poyrazoğlu
  • 33,241
  • 48
  • 191
  • 389
2
votes
0 answers

Create a custom main menu for each `NSViewController` Swift

I have an app with many ViewControllers and I need to have custom main menu for each of them (e.g. in one I need to have such buttons as "play" or "pause" and in another - "change background" or "change speed". Is there any way to do that in swift?
pomo_mondreganto
  • 2,028
  • 2
  • 28
  • 56
2
votes
3 answers

Is it possible to get an NSView to pass rightMouseDown: to the next responder without subclassing?

I have a view which contains a few subviews: mainView subViewA subViewB SubViewC mainView is an NSView constructed from a nib and is controlled with an NSViewController subclass. The subviews are standard views such as NSTextField and…
Benedict Cohen
  • 11,912
  • 7
  • 55
  • 67
2
votes
1 answer

How to display a subview loaded from a separate NIB file

I'm developing a Cocoa desktop application that uses a source list in the style of iTunes: different elements in the source list cause the main content area to display different views. The content area is entirely filled with a (vertical)…
2
votes
1 answer

NSStackView places NSViews on the baseline

Having reviewed most of Apple's (paucity) of documentation regarding NSStackView, plus the wise words of the greater Internet, including the collective wisdom of Stackoverflow, a problem remains. Any NSView I add programmatically to my (IB…
2
votes
1 answer

Correct method to present a different NSViewController in NSWindow

I am developing an app that is a single NSWindow and clicking a button inside the window will present a NSViewController, and a button exists in that controller that will present a different NSViewController. I know how to swap out views in the…
Jordan H
  • 52,571
  • 37
  • 201
  • 351
2
votes
1 answer

Slide from one view controller to another in OSX swift

I am fairly new to the OSX development and I am finding difficulty on getting some helpful material on the oSX development. I want to slide from one view controller to another. How do I do that? I know how to get from one view controller to another.…
Zeist
  • 635
  • 1
  • 7
  • 17
2
votes
1 answer

QLPreviewPanel in tableview with issue: "has no controller"

I would like to display the urls from a table view in a QLPreviewPanel but i got this error: [QL] QLError(): -[QLPreviewPanel reloadData] called while the panel has no controller - Fix this or this will raise soon. My table controller already…
2
votes
1 answer

Switching between Views using NSViewControllers in OS X

how to switch between multiple views using view controller(with the help of IBAction) ? This is the code I have written so far: In the interface file I have made an IBAction: -(IBAction)Next; and in the implementation file I have written this: -…
KLMM
  • 93
  • 1
  • 13
2
votes
1 answer

Swift IBOutlets are nil in awakeFromNib (xcode 6.1.1 osx 10.10.1)

I have a NSViewController (I'm using a storyboard) with one iboutlet connected to a NSOutlineView (yes, I have made absolutely shure that it really is connected), but when I try to reference it in awakeFromNib, the outlet is still nil although they…
Melodius
  • 2,505
  • 3
  • 22
  • 37