关键字 oc 的文章


由   YIem   撰写于    浏览:3866  评论:0
// block // 定义一个block 无返回值 无参数 void (^block1)(void) = ^(void) { NSLog(@"甜甜"); }; // 调用一个block block1(); NSInteger (^block2[...]

由   YIem   撰写于    浏览:2736  评论:0
///************* 不同类型转换 ****** // 整型转NSString int a = 3; NSString *str = [NSString stringWithFormat:@"%d", a]; NSLog(@"%@", str); // NS[...]

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

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

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

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

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

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

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

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

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

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

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

由   YIem   撰写于    浏览:3536  评论:0
// 1. 创建一个不可变字符串 str // 2. 输出 str 的长度 // 3. 将 str 中的所有 'i' 都替换为 'x' // 4. 比较 str 和 "sample" 字符串的大小, 输出较小的一个. // 5. 将 str 转为可变字符串 mutableStr // 6. 判断 mutableStr 长度, 如[...]

由   YIem   撰写于    浏览:3415  评论:0
// 获取数组的元素个数( 多用于遍历) NSLog(@"array元素个数: %ld", array.count);/// 获取某一个元素NSString *name = [array objectAtIndex:0]; NSLog(@"array获取某一个元素%@", name); // C 语言形式的取[...]

由   YIem   撰写于    浏览:2728  评论:0
/* * 向某个下标插入一个元素(insert) * 删除(delete) * 交换(exchange) */ // 向某个下标插入一个元素 [mutableArr insertObject:@"22" atIndex:2]; NSLog(@"%@", mutableArr); // 删除某个元素 [m[...]

由   YIem   撰写于    浏览:2747  评论:0
2015-12-28-- 今天我降班了,原因是字典和数组传值迷糊了然后来了新的班级,重新开始学习OC,可是,来到这个班级我还是有一种智商被压制的感觉,上课进程一塌糊涂,然后,我就开始蛋疼了,弄得好尴尬,而且重新读档一个月,又开始学习类和对象,啊....有一种要疯了的感觉,感觉和他们不在一个频道,不知道来年的四月份能不能结束.太慢了!之前的班级感觉智[...]

由   YIem   撰写于    浏览:3859  评论:0
//// AppDelegate.h// UI14_Xib//// Created by YIem on 15/12/24.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@interface AppDel[...]

由   YIem   撰写于    浏览:4086  评论:0
//// AppDelegate.h// UI13_Block传值//// Created by YIem on 15/12/23.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@interface Ap[...]

由   YIem   撰写于    浏览:4438  评论:0
//// AppDelegate.h// UI13_练习//// Created by YIem on 15/12/23.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@interface AppDele[...]

由   YIem   撰写于    浏览:3808  评论:0
//// AppDelegate.h// UI12_TavleView编辑//// Created by YIem on 15/12/22.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@interfac[...]

由   YIem   撰写于    浏览:3191  评论:0
//// AppDelegate.h// UI12_UITableVIewController//// Created by YIem on 15/12/22.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>[...]

由   YIem   撰写于    浏览:3967  评论:0
//// AppDelegate.h// UI12_RegisterCell//// Created by YIem on 15/12/22.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@interfa[...]

由   YIem   撰写于    浏览:3246  评论:0
//// AppDelegate.h// UI12_限时练习//// Created by Marry W. on 15/12/22.// Copyright © 2015年 www.lanou3g.com 蓝鸥科技. All rights reserved.//import <UIKit/UIKit.h>@interface [...]

由   YIem   撰写于    浏览:3271  评论:0
//// AppDelegate.h// UI11_UITablView综合练习//// Created by YIem on 15/12/21.// Copyright © 2015年 www.yiem.net YIem博客. All rights reserved.//import <UIKit/UIKit.h>@inter[...]