我一定是错过了一些明显的东西,但我不知道如何在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.

其他回答

用shift命令j打开导航器,它不是在左边的条带,而是在右边。

另一个选项-在项目名称上移动光标。回车。项目名称变为可编辑的。

这些对我都没用。原因是在Finder中,我已经手动更改了oldAppName。xcodeproj来

newAppName.xcodeproj 

使用新名称,所以当我尝试在Xcode 4中编辑项目名称时,我得到了一个错误,它无法保存newAppName。Xcodeproj,因为它已经存在。解决方案是更改,使用Finder, newAppName。xcodeproj来

anyOtherName.xcodeproj, 

然后我可以在Xcode中编辑项目名称,Xcode重命名anyOtherName。xcodeproj到newAppName.xcodeproj。

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

除了提供的其他答案外,如果您还想重命名您的文件默认放置的文件夹(与您的*。Xcodeproj文件),然后执行以下步骤:

- In Finder copy and paste the '<RootFolder>/<OldProjectName>' folder 
      (in the same location) and 
      rename the copied folder to '<RootFolder>/<NewProjectName>'

- In XCode in the 'Project Navigator' (first tab in the pane on the left) 

foreach ('Group' you have in your project)
{
   Select the 'Group' and observe the details in the 'File Inspector' 
          (first tab in the pane on the right)

   if ('Path' == 'Relative to Group' 
          AND 'Full Path' ==  '<RootFolder>/<OldProjectName>')
   {
           Click the icon to change the path of the 'Group' 
           Choose the '<RootFolder>/<NewProjectName> folder
   }
}

- Delete the '<RootFolder>/<OldProjectName>' folder

- Open the Project Settings, choose the Project target and under 'Build Settings' 

  - find change the path appropriately for the following values:

        'Prefix Header' and 'Info.plist file' 

做完了。

如果还有“测试”文件夹,则需要重复相同的操作。