如何将没有 .xcodeproj 文件的现有 iPhone 应用程序导入 Xcode

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15734468/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 03:06:14  来源:igfitidea点击:

How do I import existing iPhone app without .xcodeproj file into Xcode

iphonexcodeimportrecreate

提问by Robs

I have an existing iPhone app (made on a previous version of XCode by a colleague) that I would like to import into XCode. I have the files FirstViewController.h, .m, and .xib files as well as the ones for the other views that were all renamed. I also have the supporting files, such as the sqlite database that is being used, images, the AppDelegate files, and so on. However, I was given all of these files without the .xcodeproj file. I have been trying to recreate the app given all of these files, but to no luck. Can anyone please give me any hints or direction as to how I should try and recreate this app?

我有一个现有的 iPhone 应用程序(由同事在以前版本的 XCode 上制作),我想将其导入 XCode。我有文件 FirstViewController.h、.m 和 .xib 文件以及其他视图的文件,这些文件都已重命名。我还有支持文件,例如正在使用的 sqlite 数据库、图像、AppDelegate 文件等。但是,我得到了所有这些文件,但没有 .xcodeproj 文件。鉴于所有这些文件,我一直在尝试重新创建应用程序,但没有运气。任何人都可以就我应该如何尝试重新创建这个应用程序给我任何提示或方向吗?

采纳答案by Stuart M

If you absolutely cannot get ahold of the original Xcode project file, I would recommend just going through the standard New Project wizard to create a new project, and then import your existing files into the new project. This would involve, at a minimum:

如果您绝对无法获得原始 Xcode 项目文件,我建议您只需通过标准的新建项目向导创建一个新项目,然后将现有文件导入到新项目中。这至少涉及:

  • Launch Xcode (the latest available version)
  • Create a new project by choosing File menu > New > Project
  • Choose an iOS application project template which most closely resembles your application
  • Follow the rest of the wizard steps to create your project
  • Once you have your new project, import the existing files:
    • For each type of file, right click in one of the file groups in the Project Navigator in the left-hand sidebar and select 'Add Files to …', then follow the prompts to import your file(s)
  • Adjust your code to build properly, using Product > Build and Product > Run as needed.
  • 启动 Xcode(最新的可用版本)
  • 通过选择“文件”菜单 >“新建”>“项目”来创建一个新项目
  • 选择与您的应用程序最相似的 iOS 应用程序项目模板
  • 按照向导的其余步骤创建项目
  • 有了新项目后,导入现有文件:
    • 对于每种类型的文件,右键单击左侧边栏中项目导航器中的一个文件组,然后选择“将文件添加到...”,然后按照提示导入您的文件
  • 调整您的代码以正确构建,根据需要使用产品 > 构建和产品 > 运行。

The iOS App Programming Guidecan likely answer a lot of general questions about how to lay out your app structure, set up build settings, etc. Code signing and Deployment Target are two important project-specific settings you'll need to configure, which can be done using the project settings editor by selecting the very top row (where it says your project's name) in the Project Navigator. That should hopefully get you started.

iOS应用程序编程指南可能可以回答很多关于如何布置你的应用程序结构,一般问题,建立构建设置等代码签名和部署目标是两个重要的具体项目的设置,你需要配置,可以通过在项目导航器中选择最顶行(显示项目名称的位置),使用项目设置编辑器完成。这应该会让你开始。