将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


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

查看所有标签

猜你喜欢:

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

Eloquent JavaScript

Eloquent JavaScript

Marijn Haverbeke / No Starch Press / 2011-2-3 / USD 29.95

Eloquent JavaScript is a guide to JavaScript that focuses on good programming techniques rather than offering a mish-mash of cut-and-paste effects. The author teaches you how to leverage JavaScript's......一起来看看 《Eloquent JavaScript》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码