Xcode:将项目拖到工作区会在项目导航器中显示很小的 .xcodeproj 文件。怎么了?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9657691/
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
Xcode: Dragging a Project to a Workspace shows tiny .xcodeproj file in Project Navigator. What's wrong?
提问by Todd Ditchendorf
Setup:
设置:
Xcode 4.3.1 (or 5.x)
OS X 10.7.3
Xcode 4.3.1(或 5.x)
OS X 10.7.3
I have reproduced this issue on two separate late-model Macs with this setup.
我已经使用此设置在两台独立的新型 Mac 上重现了此问题。
Steps:
步骤:
- Create a new Mac "Cocoa Application" Xcode Project.
File > New > Project…
Name it "MyApp". - Create a new Workspace:
File > New > Workspace…
Name it "MySuite". - Drag
MyApp.xcodeproj
file from the Finder into the Project Navigator of "MySuite" Workspace.
- 创建一个新的 Mac“Cocoa 应用程序”Xcode 项目。
File > New > Project…
将其命名为“MyApp”。 - 创建一个新工作区:将其
File > New > Workspace…
命名为“MySuite”。 - 将
MyApp.xcodeproj
文件从 Finder 拖到“MySuite”工作区的项目导航器中。
Expected:
The Project Navigator of the "MySuite" Workspace should now show a full sub-Projectfor "MyApp" with Source, Targets, etc.
预期:
“MySuite”工作区的项目导航器现在应该显示“MyApp”的完整子项目,包括源、目标等。
Actual:
"MySuite" Workspace Project Navigator shows a tiny MyApp.xcodeproj
item in the Project Navigator. (see screenshots)
实际:
“MySuite”工作区项目导航器MyApp.xcodeproj
在项目导航器中显示一个小项目。(见截图)
Dragging:
拖动:
Result:
结果:
What am I doing wrong in trying to add a Project to a Workspace?
尝试将项目添加到工作区时我做错了什么?
回答by Sam Soffes
Be sure you don't have the project already open in another window. Xcode only lets you open a project one time. I've made this mistake a lot when working on a framework then trying to add it to an application.
确保您没有在另一个窗口中打开该项目。Xcode 只允许您打开一个项目一次。在处理框架然后尝试将其添加到应用程序时,我经常犯这个错误。
Simply close the project you're trying to drag in's window and everything will be happy.
只需关闭您要拖入的项目的窗口,一切都会很愉快。