一些文件在 xcode 中不可见.但它们在取景器中可见 [英] Some files not visible in xcode. But they are visible in finder

查看:32
本文介绍了一些文件在 xcode 中不可见.但它们在取景器中可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 IOS 编写测试用例.为此,我为IOS UI 测试"包创建了一个新目标和一些用于编写测试用例的文件.它创建了一个文件夹UITests",其中包含一些测试文件.

I am writing test cases for IOS. For that I created a new target for "IOS UI Testing" bundle and some files for writing test cases. It created a folder "UITests" with some test files in it.

问题是在 xcode 重新启动后它们在 xcode 中不可见.我能够在查找器中找到代码,并且它们也被 git 识别.但无法在 xcode 中找到它们

The problem is they are not visible in the xcode after xcode is restarted. I am able to find the code in the finder and they are also recognized by the git. But not able to find them in the xcode

这种不可预测的行为可能是什么原因?

What might be the reason for this unpredictable behaviour?

这是我手动添加文件后的 xcode 项目的屏幕截图.

Here's a screenshot of my xcode project, after I add the files manually.

现在,我可以看到文件,但我无法运行我的测试,因为它给我错误无法加载 XCTest 的底层模块".

Now, I can see the files, but I am unable to run my tests as it gives me error "Cannot load underlying module for XCTest".

推荐答案

我得到了答案.感谢@HunaidHassan.每当您添加新目标或文件时.它在 .pbxproj 文件中被引用.它保存了所有项目文件及其层次结构的引用.

I got the answer. Thanks to @HunaidHassan. whenever you do add a new target or a file. It gets referenced in the .pbxproj file. It saves the references of all the project files and its hierarchy.

我放弃了对 pbxproj 文件所做的更改,从而删除了新创建的目标和文件的引用,这导致文件从 xcode 中消失

I was discarding the changes done to pbxproj file, therby removing the references of newly created targets and files, which caused the files to disappear from the xcode

这篇关于一些文件在 xcode 中不可见.但它们在取景器中可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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