XCode 4.2:在项目导航器中重命名了项目文件,所有项目设置/配置均丢失 [英] XCode 4.2: Renamed project file in project navigator, all project settings/config lost

查看:59
本文介绍了XCode 4.2:在项目导航器中重命名了项目文件,所有项目设置/配置均丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有点恐慌...

I'm panicking a bit here...

在项目导航器中,我单击并重命名了.xcodeproj文件(认为这是重命名项目的方式).

In the project navigator, I clicked and renamed my .xcodeproj file (thinking it was the way to rename the project).

发生的事情是该项目的所有设置和文件都从项目导航器中消失了,而我留下了一个空白项目!

What has happened is that all the settings and files for the project have disappeared from the project navigator, and i'm left with a blank project!

在Finder中签入,它删除了我的旧.xcodeproj文件,并使用我给它的名称创建了一个新文件-但经检查,该文件为空!里面什么都没有.

Checking in Finder, it's removed my old .xcodeproj file, created a new one with the name I gave it - but on inspection, the file is empty! nothing inside.

我担心我可能会丢失其中的所有设置.我对Git的最后一次提交是前一段时间,因此,如果我从存储库取回它,我将丢失我所做的一些更改.

I fear I may have lost all the settings in there. My last commit to Git was a while back, so if I get it back from the repository, I will have lost some changes I made.

是否可以检索/撤消已完成的工作并还原我的项目?

Is there a way to retrieve/undo what I have done, and restore my project?

请参见下文-Alerts.xcodeproj是我不想要的新"项目.根本没有与之关联的文件.

See below - Alerts.xcodeproj is the "new" project I don't want.. no files associated with it at all.

(顺便说一句,不久前我将我的项目文件保存在新组"下-我也无法将其排序-但这可能是一个单独的问题!)

(btw, somehow a while back I got my project file under a "New Group" - and I can't get that sorted either - but that could be a separate question!)

如果使用版本编辑器,则在左窗格中可以看到以前命名的项目文件中的所有设置.但是似乎看不到它们.我本来希望在右侧窗格中看到这些内容,所以对此我也感到困惑.我可以使用版本编辑器以某种方式找回我的旧项目文件吗?

If I use the version editor, on the left pane I can see all the settings from the previously named project file.. but can't seem to get at them. I was expecting to see these on the right hand pane, actually - so I'm also confused by this. Can I use the version editor to get my old project file back somehow?

非常感谢!

更新

确定,所以我将Finder中的项目文件重命名为我的原始项目文件名-这导致我的文件等再次显示在Xcode中.好吧-差不多!

OK so I renamed the project file in Finder back to my original project filename - which has resulted in my files etc being displayed in Xcode again.. phew! Well - almost!

我现在没有计划,如下所示.方案存储在哪里?我现在需要重命名文件以匹配项目文件吗?

I now have no schemes, as you can see below. Where are schemes stored? Do I need to rename a file to match the project file now?

第二次更新-已修复!

这不是最好的解决方案,但是我找到了一种将所有内容恢复到其原始设置的方法.我确信这是一种复杂的做法-因此,我将等待一段时间,看看是否有人想出更好的解决方案.如果没有,那么我将创建并回答以下答案:

It is not the nicest solution, but I have found a way to restore everything to it's original setting. I'm sure this is a convoluted way of doing it - so I will wait a while to see if anyone comes up with a better solution. If they don't, then I'll create and answer with the answer below:

在Finder中,我将项目文件重命名为原始文件.当我启动XCode时,这会带回文件和设置.但是-没有计划!

In Finder, I renamed the project file back to what it was originally. This brought back files and settings when I launched XCode. However - no schemes!

我通过更新几个文件中的项目名称来解决此方案问题.步骤如下:

I fixed this scheme problem by updating the project name within a couple of files. here is the procedure:

  1. 右键单击您的project.xcodeproj文件,然后选择显示软件包内容"
  2. 在出现的文件夹中,向下导航到文件夹xcuserdata/(username).xcuserdatad/xschemes/
  3. 在这里打开.xscheme文件,并找到以下行,这些行将引用旧的,不需要的&错误的项目名称:

ReferencedContainer ="container:Alerts.xcodeproj"

ReferencedContainer = "container:Alerts.xcodeproj"

(在我的情况下,Alerts.xcodeproj是不正确的项目名称) 4.更改所有出现的内容以匹配正确的项目名称.

(In my case, Alerts.xcodeproj was the incorrect project name) 4. Change all occurences to match the correct project name.

Volia!解决问题.

Volia! fixes the problem.

干杯:)

推荐答案

好的,这不是最好的解决方案,但是我找到了一种将所有内容恢复到原始设置的方法.我敢肯定这是一种复杂的方法!

OK this is not the nicest solution, but I have found a way to restore everything to it's original setting. I'm sure this is a convoluted way of doing it though!

在Finder中,我将项目文件重命名为原始文件.当我启动XCode时,这会带回文件和设置.但是-没有计划!

In Finder, I renamed the project file back to what it was originally. This brought back files and settings when I launched XCode. However - no schemes!

我通过更新几个文件中的项目名称来解决此方案问题.步骤如下:

I fixed this scheme problem by updating the project name within a couple of files. here is the procedure:

  1. 右键单击您的project.xcodeproj文件,然后选择显示软件包内容"
  2. 在出现的文件夹中,向下导航到文件夹xcuserdata/(username).xcuserdatad/xschemes/
  3. 在这里打开.xscheme文件,并找到以下行,这些行将引用旧的,不需要的&错误的项目名称:

ReferencedContainer ="container:Alerts.xcodeproj"

ReferencedContainer = "container:Alerts.xcodeproj"

(在我的情况下,Alerts.xcodeproj是不正确的项目名称) 4.更改所有出现的内容以匹配正确的项目名称.

(In my case, Alerts.xcodeproj was the incorrect project name) 4. Change all occurences to match the correct project name.

Volia!解决问题.

Volia! fixes the problem.

干杯:)

这篇关于XCode 4.2:在项目导航器中重命名了项目文件,所有项目设置/配置均丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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