How can I view an XIB from an app store app?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 13:14:47

问题


I downloaded an app with nice design and unpacked it's contents. I'd like to look at the NIBs to see how the app is put together. I renamed the NIBs to XIB, but Interface Builder won't open them ("Interface Builder was unable to determine the type of PageView.xib"). Is there any way to force it to open the file. Would I be able to see anything without the original project?


回答1:


Short answer: No.

You can't just rename nib to xib, they are different formats. A nib is a package containing serialized objects in binary form, a xib is an xml representation of the serialized objects.

Longer answer:

Once upon a time binary nibs contained the information necessary in order for Interface Builder to display them (specifically, designable.nib), but since they are now primarily used for distribution (as opposed to development) that information is stripped by Xcode during application build when a xib is compiled into a nib.

Technically it is possible to instantiated a nib and introspect much of the information out of it, but it is non-trivial and wouldn't result in anything like using Interface builder.



来源:https://stackoverflow.com/questions/2256727/how-can-i-view-an-xib-from-an-app-store-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!