摘要: NSHomeDirectory(); //获取当前路径 stringByAppendingPathComponent:@"/file1" 新建文件的路径 NSFileManager: 文件管理类 [NSFileManager defaultManager]; //初始化 在文件操作中:用defau... 阅读全文
posted @ 2015-04-30 15:50 songkl 阅读(1062) 评论(0) 推荐(1) 编辑
摘要: 1 NSArray *jiangsu = [[NSArray alloc]initWithObjects:@"nanjing",@"suzhou",@"wuxi",@"changzhou", nil]; 2 3 NSArray *henan = [[NSArray alloc]... 阅读全文
posted @ 2015-04-28 20:16 songkl 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 1 NSMutableArray *mutArray1 = [[NSMutableArray alloc]init]; 2 NSDictionary *dic = [[NSDictionary alloc]initWithObjectsAndKeys:[NSNumber numb... 阅读全文
posted @ 2015-04-28 20:06 songkl 阅读(233) 评论(0) 推荐(0) 编辑
摘要: //产生随机验证码 1 //NSMutableArray *marr = [[NSMutableArray alloc]init]; //以下分别用可变 不可变数组来将对象输入 2 3 NSArray *arrtest = [[NSArray alloc]init]; 4... 阅读全文
posted @ 2015-04-28 19:58 songkl 阅读(259) 评论(0) 推荐(0) 编辑
摘要: @required-(void)mustRealizeMethod;@optional-(void)realizeOrNotMethod; 没有写@optional 默认为@required 阅读全文
posted @ 2015-04-24 11:20 songkl 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 点语法intance1.val1 = instance2.val2 instance1的点语法代表set方法 instance2的点语法代表get方法@property自动合成存取器 :自动进行成员变量的声明 以及成员变量存取器的设置。分类:只能在原先的类中增加方法功能,不能添加成员变量。 苹果不让... 阅读全文
posted @ 2015-04-24 09:30 songkl 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 资料一:一、类的继承Objective-c中类的继承与C++类似,不同的是Objective-c不支持多重继承,一个类只能有一个父类,单继承使Objective-c的继承关系很简单,易于管理程序。Objective-c中所有类的父类是NSObject。Objective-c中类的继承例子: @i... 阅读全文
posted @ 2015-04-23 14:04 songkl 阅读(5248) 评论(0) 推荐(0) 编辑
摘要: 模块:一个源文件及其中所有方法定义局部变量:包含在{}中的变量,生命周期和作用域也在{}中,默认乱码实例变量:属于对象的变量。全局量:在任何{}之外定义的量。通过extern声明可以让作用域为程序中任何地方,生命周期和程序一样,默认有初值static修饰符:让局部变量生命周期同程序,让全局量作用域为... 阅读全文
posted @ 2015-04-23 11:05 songkl 阅读(161) 评论(0) 推荐(0) 编辑
摘要: void test2(){ NSString *path = @"/Users/gx/Desktop/test_utf8.txt"; //NSString *str = [NSString stringWithContentsOfFile:path]; //UTF-8编码 N... 阅读全文
posted @ 2015-04-22 19:50 songkl 阅读(302) 评论(0) 推荐(0) 编辑
摘要: /*---------------------NSArray---------------------------*/ //创建数组 NSArray *array1 = [NSArray arrayWithObject:@"1"]; NSArray *ar... 阅读全文
posted @ 2015-04-22 19:49 songkl 阅读(249) 评论(0) 推荐(0) 编辑