How do I subclass NSWindowController?
Once you’ve decided to subclass NSWindowController, you need to make a couple of changes to the default document-based application setup. First, you should add any Interface Builder outlets and actions for your document’s user interface to the NSWindowController subclass instead of the NSDocument subclass. This is because, now, the NSWindowController subclass is the nib file’s owner. Some menu actions can still be implemented in the NSDocument subclass. For example, save and revert are implemented by NSDocument, and you might add other menu actions of your own such as an action for creating new views on a document. Second, instead of overriding windowNibName in your NSDocument subclass, override makeWindowControllers. In makeWindowControllers you should create at least one instance of your custom NSWindowController subclass and use addWindowController: to add it to the document. If your document always needs multiple controllers, create them all here. If your document will support mult
Once you’ve decided to subclass NSWindowController, you need to make a couple changes to the default document based application setup. First, any Interface Builder outlets and actions for your document’s user interface should be added to the NSWindowController subclass instead of the NSDocument subclass. This is because now, the NSWindowController subclass will be the nib file’s owner. Some menu actions can still be implemented on the NSDocument subclass. For example, save and revert are implemented by NSDocument, and you might add other menu actions of your own such as an action for creating new views on a document. Second, instead of overriding windowNibName in your NSDocument subclass, override makeWindowControllers.In makeWindowControllers you should create at least one instance of your custom NSWindowController subclass and use addWindowController: to add it to the document. If your document always needs multiple controllers, create them all here. If your document will support mul
Related Questions
- I have applied for a Subclass 485 visa and have completed an Australian Qualification Framework (AQF) III, IV or Diploma. How will I be affected by the priority processing Direction?
- How can I make an NSWindowController subclass that automatically uses a particular nib file?
- How do I subclass NSWindowController?