Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 531 Bytes

File metadata and controls

33 lines (23 loc) · 531 Bytes

理解 Objective-C 的类与对象

1. 定义类

SimpleClass.h

@interface SimpleClass : NSObject

// 属性
@property NSString *someProperty;

// 方法
- (void)someMethod;
 
@end

SimpleClass.m

#import "SimpleClass.h"
 
@implementation SimpleClass

- (void)someMethod
{
    // do something...
}

@end

2. References