Hi,
I am relatively new to Object Oriented Programming, and totally new to Cocoa.
I realize that Cocoa AppKit is really powerful and useful, but I am disappointed, disoriented.
With Project Builder, I have started a new Document Based Cocoa Application, and I can understand the basis of the structure, but there is some things I were not able to find.
If I have understood, the main.m source file instantiate NSApplication and loads the main NIB file owned by NSApplication. When I compile and launch the App, I have an instance of MyDocument that is created and the MyDocument NIB owned by MyDocument is loaded. Who instantiated MyDocument ?
I think there is something like NSApplication or NSDocumentController that do an "newDocument" action at startup.
But if I want to make a "Read Only Document App", I do not want a new document created at startup, but something like "openDocument" instead with an Open dialog window.
Moreover I want to understand how and where the Application instantiate MyDocument. How does it even knows that MyDocument.h still exists ? It is said nowhere in main.m nor MainMenu.nib, nor in "Build Settings" nor in "Application Settings". Is the "MyDocument" name reserved ?
Thanks