如何将使用 xib 的项目变成纯代码项目

  • 本文关键字:项目 代码 xib ios xib
  • 更新时间 :
  • 英文 :


我试图将从苹果的iOS开发人员库下载的xib项目变成纯代码项目以供进一步使用,但它没有奏效。

我想知道

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

将 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.

希望它能帮助你:)

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

最新更新