xcode 找不到“AppKit.framework/AppKit.h”文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8934087/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:02:29  来源:igfitidea点击:

'AppKit.framework/AppKit.h' file not found

xcodeosx-lionappkit

提问by Tyilo

Xcode outputs an error when I try to import <AppKit.framework/AppKit.h>, even though the file exists.

<AppKit.framework/AppKit.h>即使文件存在,当我尝试导入时 Xcode也会输出错误。

Example script:

示例脚本:

#import <Foundation/Foundation.h>
#import <AppKit.framework/AppKit.h>

int main (int argc, const char * argv[])
{

    @autoreleasepool {


        [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.google.com/"]];

    }
    return 0;
}

回答by Michael Dautermann

Change that line to:

将该行更改为:

#import <AppKit/AppKit.h>

And also make sure that AppKit.frameworkis added to the list of included frameworks in your project.

并确保将AppKit.framework其添加到项目中包含的框架列表中。