现在的位置: 首页 > 综合 > 正文

[iOS开发必备知识之] Category & Protocol

2013年10月09日 ⁄ 综合 ⁄ 共 331字 ⁄ 字号 评论关闭

本文来源:http://devnote.me/page/4/

http://blog.codingmylife.com/?p=41

Categories

1
2
3
4
5
6
7
8
#import
“ClassName.h”
@interface
ClassName ( CategoryName )
//
method declarations
@end
#import
“ClassName+CategoryName.h”
@implementation
ClassName ( CategoryName )
//
method definitions
@end

For example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
@interface
MyObject : NSObject{
NSNumber
*number;
}

抱歉!评论已关闭.