将Objective-C代码拆分为多个文件

栏目: Objective-C · 发布时间: 6年前

内容简介:如果有人可以请参考一个有效的例子.翻译自:https://stackoverflow.com/questions/13357775/split-objective-c-code-into-multiple-files

如果有人可以请参考一个有效的例子.

在这种情况下,我认为您正在查看类别:

您所要做的就是在.h文件中创建一个新的.h .m对:

#import MyClass.h

@interface MyClass(Networking)

//method declarations here

@end

并在.m文件中:

#import MyClass+Networking.h

@implementation MyClass(Networking)

//method definitions here

@end

在MyClass.m文件中 – 执行#import MyClass Networking.h并完成所有设置.这样你就可以扩展你的课程.

翻译自:https://stackoverflow.com/questions/13357775/split-objective-c-code-into-multiple-files


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Web Security Testing Cookbook

Web Security Testing Cookbook

Paco Hope、Ben Walther / O'Reilly Media / 2008-10-24 / USD 39.99

Among the tests you perform on web applications, security testing is perhaps the most important, yet it's often the most neglected. The recipes in the Web Security Testing Cookbook demonstrate how dev......一起来看看 《Web Security Testing Cookbook》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具