是否可以直接编辑 XIB 文件的 XML?

发布于 2024-08-09 04:48:45 字数 279 浏览 6 评论 0原文

我尝试这样做,但 Interface Builder 拒绝打开生成的文件:

alt text http: //img81.imageshack.us/img81/7194/screenshot20091102at252.png

“Interface Builder 无法确定 [文件名] 的类型”

I tried to do it, but Interface Builder refuses to open the resulting file:

alt text http://img81.imageshack.us/img81/7194/screenshot20091102at252.png

"Interface Builder was unable to determine the type of [file name]"

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

十秒萌定你 2024-08-16 04:48:45

回答你的问题(正如你在标题中所说的那样):是的,是的。我用 TextWrangler 进行了测试(移动了一个小部件),它的工作原理就像一个魅力。

我怀疑,您在编辑文件时还更改了其他内容(编码、文件名)。您应该使用 xib 的副本再次尝试,并在原始结果和结果之间进行比较。

To answer your question (as you put it in the title): Yes, it is. I did it with TextWrangler for a test (moved a widget) and it works like a charm.

I suspect, you also changed something else (encoding, file name) when you were editing the file. You should try it again with a copy of the xib and do a diff between original and result.

凉风有信 2024-08-16 04:48:45

这是可能的。该任务的复杂性已经接近用汇编程序编写 Web 应用程序的复杂性。

开玩笑。强烈不推荐。我认为这个 Xib 不是你的,接口构建器只是不允许你使用它。

It is possible. Just the task's complexity is approaching the complexity of writing an web app in assembler.

Joking. It's highly not recommended. I think this Xib is not your and Interface builder is just not allowing you to use it.

心的憧憬 2024-08-16 04:48:45

虽然 XIB 文件的 XML 格式旨在便于人类阅读,但 XIB 文件永远不应该手动编辑。虽然该文件可能看起来可合并,但对象图很复杂,除非在 Interface Builder 中进行编辑,否则无法维护。

即使它看起来有效,但这也是不受支持的,并且可能会导致未来更复杂的问题。最好在 Interface Builder 上提交增强请求以提供所需的功能,而不是尝试手动编辑 XML。

While the XML format of XIB files is intended to be somewhat human readable, XIB files should never be edited by hand. While the file may appear mergable, the object graph is complex and cannot be maintained except when edited within Interface Builder.

Even if it appears to work, this is unsupported and could lead to more complex problems down the road. It is better to instead file enhancement requests on Interface Builder to provide the capability you need, rather than try to hand edit the XML.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文