本地化后,应用程序加载不存在的 XIB
我有一个包含英语和法语本地化 XIB 文件的应用程序。当在我的开发机器上的 iPad 模拟器中运行时,当模拟器的语言设置为法语和英语时,会加载法语 XIB,否则,如预期的那样。
看起来,当在 iPad 上运行时,它无论如何都会加载英语。
我尝试编辑英语 XIB 以验证它加载了错误的版本,但此更改并未显示。
也会加载相同的 XIB,它似乎是预本地化 XIB 或英语版本的副本。
事实上,即使我已删除 XIB, 清理了所有目标。 从设备中删除了该应用程序。 关闭设备并再次打开。 已验证 XIB 不在目标的复制捆绑资源阶段。
无论使用哪种语言或是否存在 XIB,它仍然会加载 XIB,因为它看起来是预本地化的。该文件不再存在于我的项目中。
模拟器自始至终都按预期工作。当存在本地化资源时加载本地化资源,并在找不到 XIB 时抛出错误,因为它们已被删除。
如何让应用程序使用存在的本地化 XIB,而不是不存在的 XIB 内存?
I have an application with localized XIB files for English and French. When running in the iPad simulator on my development machine the French XIB is loaded when the language of the simulator is set to French and English otherwise, as expected.
It appeared that when running on the iPad it was loading the English language regardless.
I tried editing the English language XIB to verify it was loading the wrong version but this change didn't show up.
In fact the same XIB, which appears to be the pre-localization XIB or a copy of the English language version, loads even though I have:
Deleted the XIB.
Cleaned all targets.
Deleted the app from the device.
Turned the device off and on again.
Verified the XIB is not in the Copy Bundle Resources phase of the target.
Regardless of language or existence of XIB it still loads the XIB as it appeared pre-localization. This file no longer exists in my project.
The simulator, throughout, works as expected. Loading localized resources when present and throwing errors when it can't find the XIBs because they have been deleted.
How do I get the application to use a localized XIB that exists rather than a memory of a XIB that doesn't?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试删除派生数据。
一切都会好起来的。
Try delete Derived Data.
Everything will be fine.
这是一个常见问题。退出 Xcode 并重新打开项目通常可以修复该问题。
另外,请确保新创建的本地化 .xib 具有所有必需的“目标成员资格”
This is a common issue. Quitting Xcode and reopening the project will usually fix it.
Also, be sure the newly created localized .xib has all the required "Target Memberships"