微胖小生

导航

 

2013年11月8日

摘要: 字典是无序的 数组是有序的字典分为:可变字典和不可变字典01 --------不可变字典对象02 NSDictionary * dict = [[NSDictionary alloc]initWithObjectsAndKeys:@"one",@"1",@"two",@"2",@"three",@"3",@"four",@"4", nil];03 //value = key04 //初始化必须一一对应 字典的内容是键值对 key-> 阅读全文
posted @ 2013-11-08 20:54 微胖小生 阅读(109) 评论(0) 推荐(0) 编辑
 
摘要: Objective-c 数组以及字符串的拼接和分割1.OC的数组成员是任意的对象指针 与C中的链表结构类似(以nil结尾) 一切的数组操作不能越界OC的数组分为不可变数组 NSArray 可变数组 NSMutableArray01 NSArray * array = [[NSArray alloc]initWithObjects:@"one",@"two",@"three", nil];02 NSLog(@"%@",[array objectAtIndex:0]);//通过下标获取数组成员(下标从0开始)03 NS 阅读全文
posted @ 2013-11-08 20:37 微胖小生 阅读(374) 评论(0) 推荐(0) 编辑
 
摘要: 创建一个字符串对象1 NSstring * str1 = @"hello";2 NSString * str = [[NSString alloc]initWithString:@"hello world!"];3 NSString * str_1 = [[NSString alloc]initWithUTF8String:"hello world"];//把C的字符串转化为OC的字符串4 int a = 123;5 NSString * str_3 = [[NSString alloc]initWithFormat:@"a 阅读全文
posted @ 2013-11-08 20:14 微胖小生 阅读(1758) 评论(0) 推荐(0) 编辑