如何重建已删除的目标是什么? [英] How to recreate a deleted target?

查看:115
本文介绍了如何重建已删除的目标是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经删除了我的应用程序的目标,现在我所有的构建选项都没有了。因为我缺少一个目标,我不能跑我的项目。我怎么能再生吗?

I have deleted my application target and now all my Build option are gone. I cannot run my project because I am missing a target. How can I regenerate it?

推荐答案

您有两种选择。

首先是DarkDust的建议:从备份或SCM存储库恢复,如果你有他们。如果你既没有,你必须承认你找麻烦。

The first is DarkDust's suggestion: restore from a backup or an SCM repository if you have them. If you have neither, you must admit you were begging for trouble.

二是不幸的,但附带了希望的信息。从头开始重新创建目标。选择文件>从主菜单中新建>新建目标,并选择适当的目标类型(可可的M​​ac OS X应用程序,文档为主,或其他)。随着新的目标选择,单击生成阶段选项卡,展开编译来源阶段,并拖动所有的实现文件 - .M(和.c和.mm如果有的话) - 进入列表,以便他们编译成部分这个目标。展开链接二进制库阶段,并添加您使用的任何框架。展开你的资源(包括xibs,信贷,InfoPlist.strings,你的应用程序图标等)的复制包资源相和阻力。不要忘了重新创建任何文件复制阶段的建设,你可能已经手动设置(如果你没有,你已经知道如何)。这应该这样做。希望我提到的消息是,你现在了解什么是目标,所有它需要建立你的产品。它实际上比看起来要简单很多。

The second is unfortunate but comes with a message of hope. Recreate the target from scratch. Select File > New > New Target from the main menu and select the appropriate target type (a Cocoa Mac OS X application, doc-based, or whatever). With the new target selected, click the Build Phases tab, expand the Compile Sources phase, and drag all your implementation files - .m (and .c and .mm if you have them) - into the list so they're compiled as part of this target. Expand the Link Binary with Libraries phase and add in any frameworks you use. Expand the Copy Bundle Resources phase and drag in your resources (including xibs, credits, InfoPlist.strings, your app icon, etc.). Don't forget to recreate any Copy Files build phases you might have set up manually (if you did, you'll already know how). That should do it. The message of hope I mentioned is that you're now familiar with what a target is and all it needs to build your product. It's actually a lot simpler than it appears.

这篇关于如何重建已删除的目标是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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