摘要: 1 #import 2 #import "AppDelegate.h" 3 4 int main(int argc, char * argv[]) { 5 NSString *str = @"hello OC"; 6 NSString *str1 = [NSString str... 阅读全文
posted @ 2015-11-26 23:00 金胖胖 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 调用过程更加清晰+为静态方法 1 // 类定义 2 @interface People : NSObject{ 3 int _age; 4 NSString* _name; 5 } 6 // 工厂方法 静态 7 +(People*)peopleWithAge:(int)age an... 阅读全文
posted @ 2015-11-26 22:23 金胖胖 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 主要内容set get方法的使用关键字 @property 全自动生成set get方法 1 // 类的声名 2 @interface People : NSObject{ 3 int _age; // 成员变量 4 } 5 @property int age; // @property... 阅读全文
posted @ 2015-11-26 21:47 金胖胖 阅读(1084) 评论(0) 推荐(0) 编辑
摘要: 1 // 2 // main.m 3 // L02HelloObjC 4 // 5 // Created by JinXin on 15/11/25. 6 // Copyright © 2015年 JinXin. All rights reserved. 7 // 8 9 #import... 阅读全文
posted @ 2015-11-26 19:37 金胖胖 阅读(925) 评论(0) 推荐(0) 编辑