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

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


当前回答

除了提供的其他答案外,如果您还想重命名您的文件默认放置的文件夹(与您的*。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' 

做完了。

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

其他回答

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

除了提供的其他答案外,如果您还想重命名您的文件默认放置的文件夹(与您的*。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' 

做完了。

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

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

还有一个办法。

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

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

除了重命名项目外,您可能还希望重命名方案,使其与新项目名称匹配。

更改计划的名称:

Product ==>管理方案…

然后选择您的方案并按回车键编辑名称。

Product ==> New Scheme…用你的新名字创建一个新的:)