在 Xcode 4 中将项目添加到工作区时出现问题
我前段时间在 Xcode 3.2.x 下启动了几个项目。几天前我切换到 Xcode 4,并希望将工作区功能用作这两个项目。基本上,我的计划是从两个项目中提取一些共同的功能,并使它们成为两个项目所依赖的公共库。然而,在我接触到棘手的依赖关系之前,我只是将两个项目添加到工作区中而陷入困境。
我尝试创建一个新的工作区并从上下文菜单中选择“将文件添加到”;然后,我从第一个项目中选择 .xcodeproj 文件,它会显示在工作区的左侧树浏览器中。然而,这只是我得到的文件,而不是项目。也就是说,我并没有在树浏览器中获得两行条目,其中第一行表示项目名称,第二行表示类似 Apple 文档中的“1 target,iOS SDK 4.3”之类的内容,我只得到一行说明 .xcodeproj 文件的名称(包括扩展名)。左侧也没有三角形来展开节点。就像我只是在工作区中拖动了一些文件,而不是项目。第二个项目也是如此。
我还在 Xcode 4 中从头开始创建了一个新项目“Foo”,并将其添加到我的工作区中,结果相同。我查看了Apple文档并观看了大约十几次16秒的视频,但无法弄清楚我做错了什么(如果问题确实出在椅子上而不是在计算机上)。
I have a couple of projects that I had started under Xcode 3.2.x some time ago. I switched to Xcode 4 a few days ago and want to make use of the Workspace feature as both projects. Basically, my plan is to extract some common features out of the two projects and make them a common library that both projects depend on. However, before I even get to the tricky bit of dependencies I get stuck just adding my two projects to the workspace.
I tried creating a new workspace and selecting "Adding files to " from the context menu; I then select the .xcodeproj file from my first project and it appears in the left-hand side tree browser in my workspace. However, it's just the file, not the project that I get. That is, rather than getting a two-line entry in the tree browser where the first line states the project name and the second line says something like "1 target, iOS SDK 4.3" like in the Apple documentation, I get a single line simply stating the name of the .xcodeproj file including the extension. There is also no triangle on the left to expand the node. It's like I just dragged some file in the workspace, not a project. The same goes for the second project.
I have also created a new Project "Foo" from scratch in Xcode 4 and added it to my workspace, with the same result. I looked at Apple documentation and watched the 16 second video about a dozen times now, but cannot work out what I am doing wrong (if the problem is indeed in the chair and not in the computer).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我有同样的问题。我认为这是因为另一个工作区已经打开,引用了您要添加的项目。我的工作方式是:
工作正常。我有许多工作区都引用 openssl 项目,当您在 Xcode 中一次只打开一个工作区时,它似乎工作正常。
I had this exact same problem. I think it stems from having another workspace already open referencing the project you want to add. I got it working by:
Worked fine. I have many workspaces all referencing an openssl project, and it seems to work OK when you only have one workspace open at a time in Xcode.
事实上,我在不退出 Xcode 的情况下就让它工作了。
您所要做的就是确保要添加的项目已关闭,因为 Xcode 在将打开的项目添加到工作区时遇到问题。
因此:
Actually, I made it work without exiting Xcode.
All you have to do is make sure the projects you want to add are closed, since Xcode is having trouble adding open projects to a workspace.
So:
我也有同样的问题。所以我只是退出 xcode,重新启动它。然后就可以看到项目下的文件了。
I had the same problem. SO I just exit xcode, restart it. Then I can see the files under the project.
完全退出 Xcode,然后双击 .xcodeproj 文件打开项目。
Exiting Xcode completely and then double-clicking the .xcodeproj file to open the project.
它可以工作,但是当您向项目添加活动时,
r.java
文件会自动删除,并且会出现错误。It works but when you add an activity to the project than
r.java
file is automatically removed and errors are coming.