摘要: //创建一个集合 NSSet *set1 = [NSSet setWithObjects:@"1",@"2",@"3", nil]; NSSet *set2 = [[NSSet alloc] initWithObjects:@"a",@"b",@"c", nil]; NSLog(@... 阅读全文
posted @ 2015-08-22 15:34 我只想做坏蛋 阅读(254) 评论(0) 推荐(0) 编辑
摘要: //创建字典对象,以键值对的形式存储,字典里键唯一,值可以不唯一,键,值为任意对象,且只能为对象 /***** 直接创建字典 **********/ NSDictionary *dic1 = [[NSDictionary alloc] initWithObjectsAndKeys:... 阅读全文
posted @ 2015-08-19 21:08 我只想做坏蛋 阅读(117) 评论(0) 推荐(0) 编辑
摘要: //创建可变数组 NSArray *arr3 = @[@"12",@"22",@"33"]; NSMutableArray *arr1 = [[NSMutableArray alloc] init]; NSMutableArray *arr2 = [[NSMutableArr... 阅读全文
posted @ 2015-08-18 18:35 我只想做坏蛋 阅读(157) 评论(0) 推荐(0) 编辑
摘要: //字符串的创建 NSString *str1=@"123";//创建一个字符串常量 NSString *str2 = [[NSString alloc] initWithString:@"123"]; NSString *str3 = [[NSString alloc] init... 阅读全文
posted @ 2015-08-17 20:53 我只想做坏蛋 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 1.基本数据类型不是对象,因此不能向它们发消息,在cocoa中,集合只能存放对象,不能存放基本数据。2.//数字对象的初始化 //类方法创建数字对象 NSNumber * intNumber = [NSNumber numberWithInt:10]; /*int a = 10; ... 阅读全文
posted @ 2015-08-17 19:25 我只想做坏蛋 阅读(291) 评论(0) 推荐(0) 编辑
摘要: ----------------------------File.h-------------------------------#import @interface FileHelper : NSObject+(NSMutableArray *)loadData;//加载数据并保存在数组中+(vo... 阅读全文
posted @ 2015-08-15 11:44 我只想做坏蛋 阅读(521) 评论(0) 推荐(0) 编辑