如何将项目与xib转换为纯代码?

时间:2013-09-05 13:26:18

标签: ios xib

我试图将从iOS开发者库中下载的xib项目转换为纯代码,以供进一步使用,但它没有用。

我想知道在进行这种转换时我应该注意什么,我想它会帮助我提高iOS开发技巧。

2 个答案:

答案 0 :(得分:1)

有一些工具可用。例如,http://kosmaczewski.net/projects/nib2objc/

答案 1 :(得分:1)

将Xib文件转换为纯代码部分并不是一项非常大的任务,您只需要仔细替换代码部分通过“界面”构建器创建的项目。您可以在转换此类项目时遵循此顺序: -

1) Display the elements made via IB with your code.
2) Make sure the delegates and datasources to be connected via code if they were connected via     IB.
3) Check for the IBActions, if any to be replaced.
4) Lastly, if you are not using ARC or the Project that is being converted not using ARC then the dealloc part or viewDidUnload method, where we generally make the objects nil and release.

希望它可以帮助你:)