如何将 js 文件添加到我的 xcode 项目中? [英] How to add js file to my xcode project?

查看:56
本文介绍了如何将 js 文件添加到我的 xcode 项目中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 xcode 左侧项目树中添加了一些 js 和 css 文件.但是当我构建这个项目时,我收到警告:没有规则来处理架构 i386 的 sourcecode.javascript 类型的文件 '$(PROJECT_DIR)/js/builder.js'

I add some js and css files in my xcode left project tree. but when I build this project , I got the warning : no rule to process file '$(PROJECT_DIR)/js/builder.js' of type sourcecode.javascript for architecture i386

我想如果我在 xcode 中丢失了我的项目的一些设置,但是如何添加一些像 js 和 css 文件?非常感谢!

I think if I lost some setting with my project in xcode , but How to add some like js and css files? Thank you very much!

推荐答案

当你添加 JavaScript 文件时,Xcode 检测到该文件是一个源代码文件,假设你要编译它并自动将它添加到 编译源构建阶段.

When you add the JavaScript file, Xcode detects that the file is a source code file, assumes you want to compile it and automatically adds it to the Compile Sources build phase.

要停止 Xcode 尝试编译它并使其复制文件,请在 Groups and Files 列表中展开您的目标,从 Compile Sources 构建阶段中删除 JavaScript 文件并将其添加到复制捆绑资源构建阶段.

To stop Xcode trying to compile it and make it copy the file instead, expand your target in the Groups and Files list, remove the JavaScript file from the Compile Sources build phase and add it to the Copy Bundle Resources build phase.

这篇关于如何将 js 文件添加到我的 xcode 项目中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆