Xcode 8 extension executing NSTask
问题 My goal is to create an extension that executes clang-format. My code looks something like this: - (void)performCommandWithInvocation:(XCSourceEditorCommandInvocation *)invocation completionHandler:(void (^)(NSError * _Nullable nilOrError))completionHandler { NSError *error = nil; NSURL *executableURL = [[self class] executableURL]; if (!executableURL) { NSString *errorDescription = [NSString stringWithFormat:@"Failed to find clang-format. Ensure it is installed at any of these locations\n%@"