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
1 answer

How do you specify the origin of the arrow on a popover segue with OS X 10.10 storyboards

I'm playing around with storyboarding in an OS X 10.10 app. I have an NSTableView that, when you click a specific row opens a segue that goes to a popover that contains an NSViewController. How do you specify the origin NSPoint of the arrow for the…
Josh Barrow
  • 136
  • 2
  • 5
2
votes
1 answer

Set NSWindow content view from NSViewController

In my App Delegate, I load the "MainView" of the MainViewController as follows: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { MainViewController *mainvc = [[MainViewController alloc] initWithNibName:@"MainView"…
wigging
  • 8,492
  • 12
  • 75
  • 117
2
votes
2 answers

NSView inside self window

I have basic *.xib file, which have NSView. How can I use another nib files for this Custom View? What is NSViewController and how should I use it?
kosmaks
  • 117
  • 1
  • 2
  • 6
2
votes
1 answer

How exactly does an NSView, an NSViewController, and MainMenu.xib fit together?

I'm going to cut right to the chase: my application has grown quite a bit, and now I think it's time for me to do some tidying up. I want to separate some of my views from my MainMenu.xib file into their own Nib file. The part that's tripping me up…
Ben Stock
  • 1,986
  • 1
  • 22
  • 30
2
votes
1 answer

How does the cocoa "view" system work?

I mean, seriously, I don't get it at all. I'm writing this app and I need to have a sidebar which changes the content of the main part of the window. I read several documentations about the ViewController, WindowController, etc.. What I don't…
2
votes
1 answer

Understanding NSPopover with ARC

I'm somewhat puzzled by object lifetimes under ARC. Here’s a scenario which I think is probably common. 1) In response to some event, was load an NSViewController from a nib. - (IBAction) doIt: (id) sender { InfoController…
2
votes
4 answers

How do I disable drag and drop on NSTextView?

I have a NSWindowController that contains several NSViewControllers. I would like to universally accept drag and drop events with the NSWindowController class and not be intercepted by other views such as NSTextView (contained in a…
mmackh
  • 3,550
  • 3
  • 35
  • 51
2
votes
1 answer

Is it good practice to make an NSSplitView the root view for a view controller?

Is it good practice to use an NSSplitView as the root view for a view controller? I am relatively new to Objective-C OSX development and can not seem to find an answer regarding this topic. I noticed that NSViews were created by default as the root…
2
votes
2 answers

NSViewController view's not released when used in a view based NSTableView

I have a view based NSTableView that uses the views of NSViewController subclasses (InspectorViewController) : - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { // Get inspector…
Johnmph
  • 3,391
  • 24
  • 32
2
votes
3 answers

Handling messages to the first responder in a view controller

I must be missing something simple, but I can't see it. First, the setup: DATreeView, a subclass of NSView DATreeViewController, a subclass of NSViewController MainMenu.xib has an instance of DATreeViewController, which is configured to load a…
Cody Brimhall
  • 1,185
  • 1
  • 9
  • 18
2
votes
1 answer

Multiple windows mac application

I want to make a multiple windows mac application and I am stuck with the multiple window part ! I can display some windows by creating a xib file and using this method : -(void)popView:(NSString *)viewName { _windowController =…
2
votes
0 answers

Fuzzy text with Core-Plot and NSViewController

I am using an NSViewController to load a nib with a view that renders a Core-Plot chart. I replace the "target view" using the following code: NSViewController* aViewController = [[NSViewController alloc] initWithNibName:@"nib name" bundle:nil]; if…
dbainbridge
  • 1,190
  • 11
  • 18
2
votes
0 answers

Composing NSViews using Interface Builder only

I have some custom views that I want to reuse throughout my application. I create a new Objective C class in XCode and set the type to 'NSViewController'. I check the box to create .xib file for the user interface. I can go ahead and construct my…
TheNextman
  • 12,428
  • 2
  • 36
  • 75
2
votes
2 answers

Transition between windows in OS X

I am going to make an OS X application with several views and windows. It has several screens - splash, login/register and the main screen(and so on). I tried to use NSWindowControllers. However, it's so complex to use and I'm confused. What is the…
Yun
  • 5,233
  • 4
  • 21
  • 38
2
votes
1 answer

Load NSViewController from Nib

Can I load an NSViewController with its view and all the subvews from a Nib file as I usually do in UIKit with initWithNibName:bundle:? In AppKit I can load an NSWindowController with that message, but if I try to load an NSViewController, although…
Michele De Pascalis
  • 932
  • 2
  • 9
  • 26