在 Xcode 4 中重命名目标 [英] Renaming targets in Xcode 4

查看:32
本文介绍了在 Xcode 4 中重命名目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Xcode 4 中,我更改了可可应用程序的 Target 名称,因为我想更改可执行文件的名称.构建工作正常,但在编译 Xcode 后仍会启动旧的可执行文件,该可执行文件仍列在项目导航器的 Products 文件夹中.

In Xcode 4 I changed the name of my cocoa Application's Target Name because I wanted to change the name of the executable. The Build works fine but after compiling Xcode still starts the old executable that is still listed in the Products folder in the project navigator.

如何更改 Xcode 4 在构建后启动的应用程序?

How can I change which application Xcode 4 starts up after build?

推荐答案

要更改应用程序的名称,您可以选择新目标,单击 Build Settings 选项卡,查找 Packaging 部分并更改 Product Name.您会注意到导航器中 Products 组中的条目发生了变化.

To change the name of the application, you can select the new target, click the Build Settings tab, look for the Packaging section and change the Product Name. You'll notice the entry in the Products group in the navigator changes.

由于 Xcode 默认为每个目标自动创建匹配方案,您还需要确保新目标的方案设置为构建和启动新目标的匹配可执行文件.为此,请从弹出窗口中选择方案,然后从同一弹出窗口中选择编辑方案.在方案编辑器表中选择 Run 操作,并确保 Executable 弹出窗口设置为新目标的新重命名的可执行文件.对 Profile 操作执行相同的操作,以便在使用 Instruments 和所有操作时执行正确的操作.它应该已经被正确选择,但有时 Xcode 在重命名/移动东西时会感到困惑.

Since Xcode automatically creates matching schemes for each target by default, you'll also need to make sure the scheme for your new target is set to build and launch the new target's matching executable. To do this, select the scheme from the popup then choose edit scheme from the same popup. Select the Run action in the scheme editor sheet and make sure the Executable popup is set to your new target's newly-renamed executable. Do the same for the Profile action so it does the right thing when using Instruments and all. It should be properly selected already, but sometimes Xcode gets confused when renaming/moving things around.

这篇关于在 Xcode 4 中重命名目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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