1

Apple makes the point that I will rarely need to subclass NSDocumentController. OK, but I expected to see it somewhere in the project produced from the document based application template. Is it in the project, but Apple has "helpfully" hidden it? Is there something i'm missing there?

Thanks

Carl Carlson
  • 500
  • 4
  • 17

2 Answers2

1

According to this link there is a default NSDocumentController:

https://developer.apple.com/library/mac/documentation/DataManagement/Conceptual/DocBasedAppProgrammingGuideForOSX/AdvancedTopics/AdvancedTopics.html .

Other sources indicate that the first document controller created becomes the default. Presumably, a document controller inited and allocated in the application delegate would become the default and any hidden attempt to create one would happen later and would be ignored. In this way one could add one's own document controller.

This is probably explicitly explained somewhere, and I missed it. Sigh!

Carl Carlson
  • 500
  • 4
  • 17
0

If you've created a Document-based application, you can find NSDocumentController.h in

Frameworks->AppKit.

The easiest way to find this is to put this line of code

NSDocumentController* controller;

Into a .m file, and right-click->Jump To Definition on the NSDocumentController part.

Almo
  • 15,538
  • 13
  • 67
  • 95
  • Yes, but lots of things are in AppKit. Most of them are not included in any app. I can only assume that NSDocumentController is implicitly inited, allocated, and linked to Document.hm, or to the app, or perhaps to the Menu. – Carl Carlson Apr 23 '15 at 20:14
  • Then... I don't understand what your question really is. – Almo Apr 23 '15 at 20:22
  • I'm asking for an authoritative explanation possibly a confirmation but not necessarily. – Carl Carlson Apr 23 '15 at 21:45
  • Authoritative explanation of what. – Almo Apr 23 '15 at 21:47