摘要: 1 #import 2 #import "LRCManager.h"3 int main(int argc, const char * argv[]) {4 @autoreleasepool {5 [LRCManager test];6 }7 return 0... 阅读全文
posted @ 2015-11-03 22:45 GXcoder 阅读(135) 评论(0) 推荐(0) 编辑
摘要: // // 创建学生类 姓名 学号 年龄 成绩// 创建五个学生对象,加入数组, 分别按姓名升序 学号降序 年龄升序 成绩降序排序main.m 1 #import 2 #import "Student.h" 3 int main(int argc, const char * argv[]) { 4... 阅读全文
posted @ 2015-11-03 00:03 GXcoder 阅读(179) 评论(0) 推荐(0) 编辑
摘要: NSArray 有序的 自然顺序NSSet 无序的NSSet 中不能存储重复的数据,可以用它来去除重复的数据1.创建集合 1.1创建不可变集合 1 NSSet * set = [[NSSet alloc] initWithObjects:@"one",@"two",@"three",... 阅读全文
posted @ 2015-11-02 23:57 GXcoder 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 字典中存放的是键值对 可通过键取得值1.创建不可变字典1 // 1 f(1)2 NSDictionary * dic = [[NSDictionary alloc] initWithObjectsAndKeys:@"one",@"1",@"two",@"2",@"... 阅读全文
posted @ 2015-11-02 23:47 GXcoder 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 1.NSRange1 typedef struct _NSRange { 2 NSUInteger location; 3 NSUInteger length; 4 } NSRange;location 位置length 长度2.NSPoint / CGPoint1 struct CGPoint... 阅读全文
posted @ 2015-11-01 01:15 GXcoder 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 1.基本数据类型与字符串的相互转换 1.1基本数据类型转换到NSString 1 // 1 int -> 转换成NSString 2 // 5 @"5" 3 int age = 18; 4 NSString * str = [[... 阅读全文
posted @ 2015-11-01 01:06 GXcoder 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 1.创建字符串 1 // 1 直接创建字符串 2 NSString * str = @"abc"; 3 4 // NSString * stra = [[NSString alloc] initWithString:@"def"]; 5 ... 阅读全文
posted @ 2015-11-01 00:29 GXcoder 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 1.数组的创建OC中数组存储对象的地址对象方法初始化1 NSArray * arr1 = [[NSArray alloc] initWithObjects:@"one",@"two",@"three", nil];2 3 NSLog(@"%@",arr1);类方法初始化1 NSArr... 阅读全文
posted @ 2015-10-30 23:48 GXcoder 阅读(239) 评论(0) 推荐(0) 编辑