8 Replies Latest reply: Oct 20, 2012 4:06 AM by mark133
mark133 Level 1 Level 1 (65 points)

I'm trying to get to an understanding of the minimum build requirements for an xCode project.

 

When you load a New Project, it starts with an NSDocument Object template and a nib file. Is it possible to build an object and run it without the nib file? Is it possible to build a stand-alone Cocoa project as an object other than an NSDocument?


iMac
  • xnav Level 5 Level 5 (6,635 points)

    Yes, remove the check mark from "Create Document-Based Application"

    Screen Shot 2012-07-13 at 2.54.42 PM, Jul 13.jpg

  • mark133 Level 1 Level 1 (65 points)

    So apparently the only difference between the two copies (one works and one doesn't) is that one has its own document type?

     

    You have a class prefix of FSB, is that your own class and extension?

     

    DocumentType.png

  • mark133 Level 1 Level 1 (65 points)

    I guess even if all the methods and messages in an object are self contained, the limit is that at some point the method(s) that makes anything happen has to be called from the super class? And that's why NSObject doesn't work for a superclass, because it doesn't call any method on it's own?

  • mark133 Level 1 Level 1 (65 points)

    So if I have an application delegate, there is only one place in the code where a method is called from the superclass, and so any original code has to start in that block. But if it's an NSDocument with a window, etc, then there are several methods that are called from the superclass, and original code can start from anywhere in those blocks?

  • xnav Level 5 Level 5 (6,635 points)

    You have a class prefix of FSB, is that your own class and extension?

     

    FSB was the prefix I happened to be using for my last project.

  • xnav Level 5 Level 5 (6,635 points)

    See 'Root Class' in the Cocoa Fundamentals Guide.

  • xnav Level 5 Level 5 (6,635 points)

    mark133 wrote:

     

    So if I have an application delegate, there is only one place in the code where a method is called from the superclass, and so any original code has to start in that block. But if it's an NSDocument with a window, etc, then there are several methods that are called from the superclass, and original code can start from anywhere in those blocks?

    This supposition ignores the protocol methods offered by the application delegate.

     

    @interface myCreateAppDelegate : NSObject <NSApplicationDelegate>  {
    

     

    See the NSApplicationDelegate Reference.

  • mark133 Level 1 Level 1 (65 points)

    Thank you for taking the time to provide those pointers, xnav. Looking back at my question, I don't see how you were able to unravel it, apart from a tremendous desire to be helpful. I've since learned enough of Cocoa (including through these pointers you provided) to have a satisfactory answer to this, likely common, question. Still, I can't quite figure out how I would answer it.