Skip to main content
2 votes
1 answer
76 views

Context Consider this protocol and class in Swift 5.9: protocol SpinnerHosting: AnyObject { var spinnerItem: SpinnerItem { get } } final class MyViewController: NSViewController { var ...
Bryan's user avatar
  • 6,035
0 votes
2 answers
69 views

Why is the MyViewController does not get's shown in the window although the it's stated in the contentViewController: MyViewController() ? I'm not on storyboard or XIB and I don't wanna use a nib file....
KanKonga's user avatar
1 vote
1 answer
41 views

The code should just view a "Hello, World!" in the window. The window appears but the text is not showing. Why is that? I can see that the window.makeKeyAndOrderFront(nil) even orders the ...
KanKonga's user avatar
0 votes
0 answers
45 views

I used an Objective-C method to get the managedObjects on Xcode 9.2. Today I have a new iMac with Xcode 14.3 and the method is not called. -(void)awakeFromNib { _center = [NSNotificationCenter ...
Uwe Jagoda's user avatar
0 votes
2 answers
2k views

I have a Foundation macOS App written in Swift. I'm trying to use SwiftUI Chart View in NSViewcontroller (tutorial here) but it's seems import Charts doesn't recognized and I obtain the error Cannot ...
Fry's user avatar
  • 6,305
0 votes
1 answer
281 views

I want to be able to retrieve the NSWindowController of a specific class of window opened by my app, returning the customer class of that window. The code walks through the window list, looking for ...
johnpurlia's user avatar
1 vote
2 answers
498 views

step1. I new a project in Xcode 13.2.1 with macOS App, swift and storyboard step2. The default NSViewController named InitialViewController. I add a button named open. step3. I add a NSViewController ...
marky1's user avatar
  • 43
0 votes
0 answers
58 views

I am trying to make NSViewControler work with NSView. I can't get myView to call any function in myView(NSView). myView?.myFunctionName does not work and for NSView I get a nil error when I try set ...
Andy Hazlett's user avatar
0 votes
0 answers
44 views

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 ...
lpetrich's user avatar
0 votes
0 answers
60 views

I am using NSView as a digital display screen. When I invoke [display setNeedsDisplay:YES] The view's drawrect function seems to entirely clear the view before redrawing it contents. This results in ...
exception's user avatar
  • 326
0 votes
1 answer
334 views

I've a custom NSViewController subclass that implements the NSMenuItemValidation protocol. That works just fine, until I mark the view controller as @MainActor. I believed Apple marked all view ...
Remco Poelstra's user avatar
0 votes
1 answer
74 views

I am new in Swift and have a question. I have ViewController for my customer with a included a tableView that list their past invoice. When I double click on an invoice, it open the Invoice ...
S Lareau's user avatar
  • 199
-1 votes
1 answer
107 views

I am trying to programmatically switch to another viewController scene when a certain event happens in Xcode for a MacOS app but am having trouble. The second view controller is in the same storyboard ...
Ninten's user avatar
  • 7
0 votes
2 answers
415 views

There is a method in NSViewController called viewDidAppear. The docs say: This method is called after the completion of any drawing and animations involved in the initial appearance of the view. If ...
Rob N's user avatar
  • 16.7k
1 vote
2 answers
1k views

Either there is something weird in my project (Mojave, XCode10) or I am missing something very basic. This is my whole code: import Foundation import Cocoa class ViewController: NSViewController { ...
MassMover's user avatar
  • 577

15 30 50 per page
1
2 3 4 5
28