How to quit itself in Objective-C application?

前端 未结 2 1016
没有蜡笔的小新
没有蜡笔的小新 2021-01-17 19:10

I have a URLHandler that launches some application, the main code is as follows.

@implementation URLHandlerCommand

- (id)performDefaultImplementation {
             


        
2条回答
  •  借酒劲吻你
    2021-01-17 19:35

    1. You don't have to launch open using NSTask... open just calls into Launch Services, some of whose functionality is directly available from NSWorkspace.

    2. To quit, you just call [[NSApplication sharedApplication] terminate:nil]. See NSApplication documentation.

提交回复
热议问题