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

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

内容简介:如果有人可以请参考一个有效的例子.翻译自: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


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

查看所有标签

猜你喜欢:

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

Introduction to Computer Science Using Python

Introduction to Computer Science Using Python

Dierbach, Charles / 2012-12 / $ 133.62

Introduction to Computer Science Using Python: A Computational Problem-Solving Focus introduces students to programming and computational problem-solving via a back-to-basics, step-by-step, objects-la......一起来看看 《Introduction to Computer Science Using Python》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

html转js在线工具
html转js在线工具

html转js在线工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换