Creating a Cocoa application without NIB files

前端 未结 11 746
余生分开走
余生分开走 2020-12-04 10:24

Yes, I know this goes against the whole MVC principle!

However, I\'m just trying to whip up a pretty trivial application - and I\'ve pretty much implemented it. Howe

11条回答
  •  再見小時候
    2020-12-04 10:37

    Here is Casper's solution, updated for ARC as per Marco's suggestion:

    #import 
    #import "AppDelegate.h"
    
    int main(int argc, char * argv[]) {
        @autoreleasepool {
            NSApplication *application = [NSApplication sharedApplication];
            AppDelegate *appDelegate = [[AppDelegate alloc] init];
            [application setDelegate:appDelegate];
            [application run];
        }
        return EXIT_SUCCESS;
    }
    

提交回复
热议问题