面向对象特性
#import int main(int argc, const char * argv[]) { } |
self和类方法
// #import //闪光灯状态 typedef enum { }FlashlightStatus; @interface Iphone : NSObject { } - (void)setCpu:(int)cpu; - (int)cpu; //拍照方法 + (void)cameraWithFlashlightStat //打开闪光灯 + (void)openFlashlight; //关闭闪光灯 + (void)closeFlashlight; @end // #import "Iphone.h" @implementation Iphone + (void)cameraWithFlashlightStat { // // // // // // // } + (void)openFlashlight { } + (void)closeFlashlight { } - (void)setCpu:(int)cpu { } - (int)cpu { } @end // #import #import "Iphone.h" int main(int argc, const char * argv[]) { } |
self和对象方法成员变量
// #import //闪光灯状态 typedef enum { }FlashlightStatus; @interface Iphone : NSObject { } - (void)setCpu:(int)cpu; - (int)cpu; //拍照方法 //+ (void)cameraWithFlashlightStat - (void)cameraWithFlashlightStat //打开闪光灯 - (void)openFlashlight; //关闭闪光灯 - (void)closeFlashlight; 打开闪光灯 //+ (void)openFlashlight; 关闭闪光灯 //+ (void)closeFlashlight; @end // #import "Iphone.h" @implementation Iphone - (void)cameraWithFlashlightStat { } // #import #import "Iphone.h" int main(int argc, const char * argv[]) { // // |