Cocoa app without a MainMenu.xib

后端 未结 2 909
面向向阳花
面向向阳花 2021-02-07 18:49

For iOS (Cocoa Touch), it\'s possible to go to your main.m and replace the fourth argument in UIApplicationMain(int argc, char *argv[], nil, nil) with the class nam

相关标签:
2条回答
  • 2021-02-07 19:00

    You can use setDelegate method of NSApplication instance. Here is a sample:

    AppDelegate * delegate = [[AppDelegate alloc] init];
    [[NSApplication sharedApplication] setDelegate:delegate];
    [NSApp run];
    

    As for return value you can use EXIT_SUCCESS

    0 讨论(0)
  • 2021-02-07 19:11

    Subclass NSApplication, declare your subclass's name as the Application Class (or similar) property in Xcode. In your subclass you may override some function that gets called when the app is initialized, maybe -finishLaunching?

    0 讨论(0)
提交回复
热议问题