是否可以直接编辑 XIB 文件的 XML?
我尝试这样做,但 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
回答你的问题(正如你在标题中所说的那样):是的,是的。我用 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.
这是可能的。该任务的复杂性已经接近用汇编程序编写 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.
虽然 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.