将图像资源存储在 .bundle 中的优点
有人告诉我这样做是最佳做法。我知道 Facebook iOS SDK 会执行此操作(查看 FBDialog.bundle 内部
文件)。还有一些关于如何创建它们的问题。苹果还有一个 捆绑编程指南。
但简而言之(除了本地化之外),将图像资源存储在 .bundle 文件中是否有显着的优点?
编辑:我知道 .app 产品本身就是一个捆绑包。这不是我的问题。问题是是否将图像资源存储在默认的“Resources”组中,还是将它们存储在“Resource.bundle”文件中,就像 Facebook iOS SDK 那样。
I've been told that it's best practice to do so. I know the Facebook iOS SDK does this (look inside the FBDialog.bundle
file). There are a few SO questions about how to create them as well. Apple also has a Bundle Programming Guide.
But in a nutshell (and localization aside), are there significant pros of storing image resources inside a .bundle file?
EDIT: I know that the .app product is a bundle itself. That is not my question. The question is whether to store the image resources inside the default "Resources" group or to store them inside a "Resource.bundle" file, like the Facebook iOS SDK does.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
它只是为您的应用程序包添加了另一层组织,使其更加全面。我认为以这种方式使用捆绑包的唯一严格优势是避免在同一项目中使用大量第三方代码时潜在的文件冲突。
It just adds another layer of organization to your application bundle, making it more comprehensive. The only strict advantage I could see for using bundles in this manner would be to avoid potential file conflicts when using lots of 3rd party code in a same project.
捆绑包提供了组织资源的标准化结构。在 iOS 上,您在存储资源的位置方面并没有多种选择。
Bundles provide a standardized structure for organizing resources. On iOS it's not like you have a wide range of options with respect to where you store resources.