Classes 文件夹中的 XIB 文件,有问题吗?
因此,在我的 XCode 项目中,我有一些 XIB 文件,由于某种原因,这些文件实际上位于文件系统的 Classes 文件夹中,但显示在 XCode 的 Resources 文件夹中。这有什么问题吗?我应该费心去移动它们吗?
该代码工作正常,可以在模拟器和设备上运行,所以我主要担心的是,当我提交给 Apple 或其他任何地方时,它是否会导致任何问题。
So in my XCode project I have a handful of XIB files that for one reason or another are physically in the Classes folder on the filesystem, but show in the Resources folder in XCode. Is there any problem with that? Should I bother trying to move them?
The code is working fine, runs on simulator and device, so my main concern is whether it will cause any problems when I submit to Apple, or anywhere else down the road.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这绝对没有意义 - 唯一影响您的最终产品(以及您提交给 Apple 的内容)的是不同文件出现在 Target 的哪个阶段,根据我的经验,这些结果很少会出错。
然而,如果没有别的原因,为了整洁起见,解决这个问题可能是值得的。将文件移动到正确的位置*,这将使 XCode 中的文件名变成红色。选择每个红色文件的“获取信息”,然后单击“选择”按钮找到它。
(*如果您使用的是 Subversion,请使用
svn move
命令,而不是 Finder)It's absolutely meaningless - the only thing that affects your final product (and therefore what you submit to Apple) is which stage of your Target the different files appear under, and in my experience those rarely end up wrong.
However, for tidiness' sake if nothing else, it might be worth fixing the problem. Move the files to the right place*, which will turn the filename red in XCode. Choose Get Info on each red file and click the "Choose" button to locate it.
(* if you're using Subversion, use the
svn move
command for this, not the Finder)所有资源文件都存储在应用程序包的平面目录中。您可以控制单击 .app 文件并通过选择在查找器中显示来查看平面目录。文件实际存在于源中的位置并不重要。如果你把一些资源文件放在class目录下,对代码的管理没有任何问题,那么就不会有问题。这意味着苹果不会介意。
但是,如果您计划与多人一起长期维护该项目,那么我认为最好有组织良好的源代码。
All the resource files are stored in a flat directory in app bundle. You can control click on .app file and see the flat directory by selecting reveal in finder. It really does not matter where the file is physically present in source. If you don't have any problem with the management of the code by placing some resource files in class directory, then there will be no problem. That means Apple will not mind.
However if you are planning to maintain the project for a long time with multiple people then I think it is better to have well organized source.