且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

“ import”和“ import”之间有什么区别?框架和“链接”的概念与框架?

更新时间:2023-11-06 10:48:34

源代码中的导入有助于代码的编译,确保找到正确的标题。 项目设置中构建阶段的链接二进制文件与库部分(现在也包含在链接的库和框架下的摘要选项卡中)指定了将与您的对象代码链接的框架和库。

The import in the source code facilitates compilation of your code, ensuring that the correct headers are found. The "Link Binary with Libraries" section of the "Build Phases" in "Project Settings" (now also included on the "Summary" tab under "Linked Libraries and Frameworks") specifies with which frameworks and libraries your object code will be linked.

从历史上看,我们总是需要分别指定这两个,但是现在有一个项目设置自动链接框架,如果启用,它将自动将框架链接到您的项目如果您在源代码中导入。您还必须同时启用启用模块。

Historically we always needed to specify these two separately, but now there is a project setting "Link Frameworks Automatically", which if on, will automatically link the framework to your project if you import it in your source code. You also must have "Enable Modules" turned on, too.