关键字 2016 的文章


由   YIem   撰写于    浏览:2945  评论:0
// 重写系统调用的释放方法// 以后在mrc下 如果定义了retian/copy的属性// 都需要重写dealloc方法 并将其release在此处(void)dealloc{// getter的autorelease回引起延时减 1 // [self.name release]; [_name release]; [super dealloc];}

由   YIem   撰写于    浏览:2637  评论:0
// alloc retain copy 引用计数加 1 // release autorelease 引用计数减 1 // 当对象被添进collection类型中时 对象引用计数加 1 // 当对象被移除collection类型中时 对象引用计数减 1 // 当collection类型的数[...]

由   YIem   撰写于    浏览:3613  评论:0
/********* 方法2 简单类型对象的排序 ************/if 0// 创建排序对象 // 参数1 - 为简单类型对象可填写nil/@"self" // 为复杂类型对象可填写要进行排序的关键字, 如 按照Person的name成员排序 可填写@"name"; //参数2 [...]

由   YIem   撰写于    浏览:3003  评论:0
.main.m 代码 /********** 自定义类型对象的排序 *****************/ Person *per1 = [[Person alloc] initWithName:@"Long" age:22]; Person *per2 = [[Person alloc] initWithName:@[...]

由   YIem   撰写于    浏览:2860  评论:0
/*************** 简单对象的排序 *****************/ // 排序 可变数组NSMutableArray *arr = [NSMutableArray arrayWithObjects:@"8", @"2", @"3", @"5", [...]

由   YIem   撰写于    浏览:3393  评论:0
// 集合 - 集合的元素具有唯一性 // 常用于判断交/并集等操作 /// 不可变集合// 创建集合 // 如果有重复元素 只保留一个 eg;@"2", @"2" NSSet *set = [NSSet setWithObjects:@"1",@"2" , @[...]

由   YIem   撰写于    浏览:6565  评论:0
OC- 字典套数组 -- 省市区// 获取文件 NSString *str = [NSString stringWithContentsOfFile:@"area.txt" encoding:NSUTF8StringEncoding error:nil]; // 按\n截取 NSArray *line = [str compon[...]

由   YIem   撰写于    浏览:3582  评论:0
省市区OC-字典-省市区-省数组套省字典套市数组套市字典套区数组数据文件:省市区TXT(数据)文件 NSString *str = [NSString stringWithContentsOfFile:@"area.txt" encoding:NSUTF8StringEncoding error:nil]; NSLog(@&qu[...]

由   YIem   撰写于    浏览:3095  评论:0
分别有三个文件.mian.mint main(int argc, const char * argv[]) { // 创建学生 Student *stu1 = [[Student alloc]initWithName:@"卞一" sex:@"男" age:@"20"]; Student [...]

由   YIem   撰写于    浏览:2799  评论:0
OC-可变字典(NSMutableDictionary)操作// 可变字典创建 NSMutableDictionary *mdic = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"卞一", @"name", @"男", @&quo[...]

由   YIem   撰写于    浏览:2835  评论:0
OC-不可变字典(NSDictionary) 操作// 不可变字典 创建 NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"卞一", @"name", @"男", @"sex", @&quo[...]

由   YIem   撰写于    浏览:2500  评论:0
创建可变数和不可变数组的中文方法// 中文版 NSArray *阿尔 = @[@"AAA"]; NSLog(@"%@", 阿尔); NSLog(@"%ld", 阿尔.count); NSArray *卞一 = @[@"YIem", @"YI", @&[...]

由   YIem   撰写于    浏览:3095  评论:0
可变数组和不可变数组的快速创建-修改-赋值-替换-判断等等NSArray *arr = @[@"aa", @"bb", @"cc", @"dd", @"ff", @"ee", @"gg"]; // 获取数组的[...]

由   YIem   撰写于    浏览:3049  评论:0
可变数组的各种操作// 可变数组 NSMutableArray *mArr = [NSMutableArray arrayWithObjects:@"aaa", @"bbb", @"ccc", @"ddd", @"eee", nil]; // 添加一[...]

由   YIem   撰写于    浏览:2541  评论:0
创建不可变数组,对其的各种操作 // 创建数组 NSArray *arr = @[@"aa", @"bb", @"dd", @"12", @"ff"]; // 获取数组对象个数 NSLog(@"%ld", arr.count);[...]

由   YIem   撰写于    浏览:3728  评论:0
迟来的新年祝福,2016年我要好好的

由   YIem   撰写于    浏览:3397  评论:0
//// main.m// OC_7遍历//// Created by YIem on 15/12/2.// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.//import <Foundation/Foundation.h>import "Model.h[...]

由   YIem   撰写于    浏览:4794  评论:0
//// main.m// OC6_省市区//// Created by YIem on 15/12/1.// Copyright (c) 2015年 www.yiem.net YIem博客. All rights reserved.//import <Foundation/Foundation.h>import "Model.[...]