我一定是错过了一些明显的东西,但我不知道如何在Xcode 4重命名我的项目。

如果我没记错的话,Xcode 3有一个专门的菜单项,但在Xcode 4中没有这样的入口。


当前回答

来自苹果:iOS开发者库技术问答q1625

Follow these steps to rename your application in Xcode 4.0 or later: In Xcode, select your target under "Targets" in the project editor, then choose View > Utilities > Show File Inspector. Xcode opens the file inspector pane. Enter your application's new name in the Project Name field as shown in Figure 1, then hit the return key on your keyboard. Xcode displays a project-rename dialog that contains all the items that can be renamed in your project. Leave your application selected in the dialog and deselect all other items as shown in Figure 2, then click Rename to perform the rename operation.

其他回答

还有一个办法。

要在Xcode 4中重命名一个项目,从项目窗口左侧的项目导航器中选择项目文件。选择“View > Utilities > File Inspector”,打开项目窗口右侧的文件检查器。在文件检查器的顶部是Project Name文本字段。输入一个新的项目名称并按回车键或Tab键。

将打开一个工作表,询问是否要重命名项目内容项。单击Rename按钮完成项目的重命名。

重命名项目确实是最好的方法。

以下是我在Xcode 4.3.2中所做的:

在查找器中复制原始项目 在新文件夹中打开项目文件。 选择项目(蓝色小图标) 再次单击并输入新的项目名称。这样可以做出合理的选择,比如更改目标,更改项目文件名和所有适当的引用。

我用一堆类似的后端框架和图标自定义配件。没有什么是完美的,但当应用程序有很多相似之处时,这是一种节省大量配置点击的快速方法。

事实证明,这确实是一件微不足道的事情。

你所需要做的就是在项目导航器的项目根目录上缓慢点击两次,然后它就变成可编辑的了。在您重命名项目并按下“enter”后,它会提示自动更改所有与项目名称相关的条目,并允许您取消选择其中一些。

好了。

来自苹果:iOS开发者库技术问答q1625

Follow these steps to rename your application in Xcode 4.0 or later: In Xcode, select your target under "Targets" in the project editor, then choose View > Utilities > Show File Inspector. Xcode opens the file inspector pane. Enter your application's new name in the Project Name field as shown in Figure 1, then hit the return key on your keyboard. Xcode displays a project-rename dialog that contains all the items that can be renamed in your project. Leave your application selected in the dialog and deselect all other items as shown in Figure 2, then click Rename to perform the rename operation.

我也遇到过这个问题。我所做的就是更改TARGETS的名称。然后在iPhone或模拟器上显示的名称会发生变化。项目中的文件名称不会改变。 试试这个方法。