具有非标准名称的设置捆绑包
我可以在 xcode 中使用不名为 Settings.bundle 的设置包吗?
如果我有多个设置包(针对多个构建目标),我必须在任何地方定义这些附加名称吗?我的应用程序似乎总是寻找一个名为 Settings.bundle 的应用程序。
May I use a settings bundle in xcode which is not called Settings.bundle?
If I have multiple settings bundles (for multiple build targets), must I define these additional names anywhere? My application seems to always look for one called Settings.bundle.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于那些不擅长 shell 脚本的人,这里有一个我使用的模板版本。除了调试和发布构建之外,我们还有一个调试特殊构建,在构建设置中有自己的 Info.plist 以及不同的 Settings.bundle/Root.plist 文件。我创建了 Settings.bundle/ 文件夹到 Settings(original).bundle 和 Settings(special).bundle 的副本,并将此脚本添加到预构建中:
subdir="original" ; [[ $CONFIGURATION = "调试特殊"]] &&子目录=“特殊”; cp "$SRCROOT/Settings($subdir).bundle/Root.plist" "$SRCROOT/Settings.bundle/"
请务必选择您的项目以将环境变量添加到运行脚本的 shell。
我意识到该线程在代码年中已经相当老了,但它仍然相关,希望这可以节省下一个找到它的人的时间。
For those of you who aren't good at shell scripts, here's a template version of what I used. In addition to a Debug and Release build, we also had a Debug-Special build with its own Info.plist in the build settings, and a different Settings.bundle/Root.plist file. I created copies of the Setting.bundle/ folder to Settings(original).bundle and Settings(special).bundle and added this script to the pre-build:
subdir="original" ; [[ $CONFIGURATION = "Debug-Special" ]] && subdir="special" ; cp "$SRCROOT/Settings($subdir).bundle/Root.plist" "$SRCROOT/Settings.bundle/"
Be sure to select your project to add the environment variables to the shell that runs the script.
I realize the thread is pretty old in code years but it is still relevant, and hopefully this will save the next person who finds it some time.
通过在预构建中添加脚本解决了这个问题,其中替代包被重命名为 Settings.bundle
Solved this by adding a script in pre-build where the alternative bundle is renamed to Settings.bundle