04 2016 档案

摘要:setter方法 - (void)setRoom:(Room *)room { // 传进来的room和_room不一样的时候 if (_room != room) { // 对旧房间(当前正在用的房间)做一次release操作 [_room release]; // 对新房间做一次retian操作 阅读全文
posted @ 2016-04-29 15:46 Huster2009 阅读(137) 评论(0) 推荐(0)
摘要:什么是runtime? 1> runtime是一套底层的C语言API(包含很多强大实用的C语言数据类型、C语言函数) 2> 实际上,平时我们编写的OC代码,底层都是基于runtime实现的 * 也就是说,平时我们编写的OC代码,最终都是转成了底层的runtime代码(C语言代码) runtime有啥 阅读全文
posted @ 2016-04-28 11:35 Huster2009 阅读(1308) 评论(0) 推荐(0)
摘要:dispatch_group_notify(group, queue, ^{ // 1.开启新的图形上下文 UIGraphicsBeginImageContext(CGSizeMake(100, 100)); // 2.绘制图片 [self.image1 drawInRect:CGRectMake( 阅读全文
posted @ 2016-04-24 23:18 Huster2009 阅读(232) 评论(0) 推荐(0)
摘要:测试耗时时间的方法 // 方法一 NSDate *begin = [NSDate date]; // 根据图片的网络路径去下载图片数据 NSData *data = [NSData dataWithContentsOfURL:url]; NSDate *end = [NSDate date]; NS 阅读全文
posted @ 2016-04-24 00:02 Huster2009 阅读(532) 评论(0) 推荐(0)
摘要:1.更换源 Gem是一个管理Ruby库和程序的标准包,它通过Ruby Gem(如 http://rubygems.org/)源来查找、安装、升级、和卸载软件包 gem sources --remove https://rubygems.org/ gem sources -a https://ruby 阅读全文
posted @ 2016-04-22 23:18 Huster2009 阅读(129) 评论(0) 推荐(0)
摘要:HTTP请求的常见方法- GET - 所有参数拼接在URL后面,并且参数之间用&隔开 - 比如http://xxx?name=123&pwd=345 - 传递了2个参数给服务器 - name参数:123 - pwd参数:345 - 没有请求体 - 一般用来查询数据- POST - 所有参数都放在`请 阅读全文
posted @ 2016-04-20 19:56 Huster2009 阅读(1370) 评论(0) 推荐(0)
摘要:/***************创建队列的方式**************/ 1.主队列,凡是添加到主队列中的任务(NSOperation),都会放到主线程中执行 NSOperationQueue *queue = [NSOperationQueue mainQueue]; 2.其它队列(串行队列、 阅读全文
posted @ 2016-04-19 14:36 Huster2009 阅读(148) 评论(0) 推荐(0)
摘要:/*************异步函数 + 并发队列:可以同时开启多条线程***************/ /*************同步函数 + 并发队列:不会开启新的线程***************/ /*************异步函数 + 串行队列:会开启新的线程,但是任务是串行的,执行完 阅读全文
posted @ 2016-04-19 12:49 Huster2009 阅读(180) 评论(0) 推荐(0)
摘要:/********线程的状态**************************************/ 线程的状态:新建状态(New) >就绪状态(Runnable) >运行状态(Running) >阻塞状态(Blocked) >死亡状态(Dead) 启动线程 - (void)start; // 阅读全文
posted @ 2016-04-19 11:04 Huster2009 阅读(172) 评论(0) 推荐(0)
摘要://1. 创建一个plist文件 NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); NSString *path=[paths objectAtIndex:0]; 阅读全文
posted @ 2016-04-16 23:21 Huster2009 阅读(164) 评论(0) 推荐(0)
摘要:代理 代理设计模式的作用: 1.A对象监听B对象的一些行为,A成为B的代理 2.B对象想告诉A对象一些事情,A成为B的代理 代理设计模式的总结: 如果你想监听别人的一些行为,那么你就要成为别人的代理 如果你想告诉别人一些事情,那么就让别人成为你的代理 代理设计模式的开发步骤 1.拟一份协议(协议名字 阅读全文
posted @ 2016-04-15 15:52 Huster2009 阅读(162) 评论(0) 推荐(0)
摘要:tableView性能优化 - cell的循环利用方式1 / * 什么时候调用:每当有一个cell进入视野范围内就会调用 / - (UITableViewCell )tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPat 阅读全文
posted @ 2016-04-15 14:05 Huster2009 阅读(155) 评论(0) 推荐(0)
摘要:使用代码实现Autolayout的方法1 创建约束 +(id)constraintWithItem:(id)view1 attribute:(NSLayoutAttribute)attr1 relatedBy:(NSLayoutRelation)relation toItem:(id)view2 a 阅读全文
posted @ 2016-04-14 17:48 Huster2009 阅读(126) 评论(0) 推荐(0)
摘要:九宫格计算思路 利用控件的索引index计算出控件所在的行号和列号 利用列号计算控件的x值 利用行号计算控件的y值 HUD 其他说法:指示器、遮盖、蒙板 半透明HUD的做法 背景色设置为半透明颜色 背景色设置为半透明颜色 定时任务 方法1:performSelector // 1.5s后自动调用se 阅读全文
posted @ 2016-04-13 22:15 Huster2009 阅读(138) 评论(0) 推荐(0)
摘要:storyboard文件的认识 用来描述软件界面 默认情况下,程序一启动就会加载Main.storyboard 加载storyboard时,会首先创建和显示箭头所指的控制器界面 IBAction和IBOutlet IBAction: 本质就是void 能让方法具备连线的功能 IBOutlet 能让属 阅读全文
posted @ 2016-04-13 21:35 Huster2009 阅读(202) 评论(0) 推荐(0)
摘要:重写prepareLayout方法- 作用:在这个方法中做一些初始化操作- 注意:一定要调用[super prepareLayout] 重写layoutAttributesForElementsInRect:方法- 作用: - 这个方法的返回值是个数组 - 这个数组中存放的都是UICollectio 阅读全文
posted @ 2016-04-13 20:35 Huster2009 阅读(7166) 评论(0) 推荐(1)
摘要:首先导入框架 然后通过滤镜CIFiter生成二维码 #import <CoreImage/CoreImage.h> /** * 生成二维码 */ - (void)creat { //1.创建过滤对象 CIFilter *filter = [CIFilter filterWithName:@"CIQR 阅读全文
posted @ 2016-04-11 22:34 Huster2009 阅读(231) 评论(0) 推荐(0)
摘要:1. 首先查看 Xcode 的 UUID,在终端执行 defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID 会得到一串 UUID 码 2. 找到 Xcode 插件所在的目录 ~/Library/A 阅读全文
posted @ 2016-04-11 20:42 Huster2009 阅读(143) 评论(0) 推荐(0)
摘要:第一步:建立git仓库 cd到你的本地项目根目录下,执行git命令 git init 第二步:将项目的所有文件添加到仓库中 git add . 如果想添加某个特定的文件,只需把.换成特定的文件名即可 第三步:将add的文件commit到仓库 git commit -m "注释语句" 第四步:去git 阅读全文
posted @ 2016-04-07 17:03 Huster2009 阅读(358) 评论(0) 推荐(0)
摘要:快捷键:1、切换头文件和m.文件,很实用Command + control+ 上下箭头键2、go back,回退,就是回到你上次打开的页面。control+command+ 左箭头3、go forward 回到你前面打开的页面control+command+ 右箭头 4.文档内搜索Command + 阅读全文
posted @ 2016-04-07 16:46 Huster2009 阅读(241) 评论(0) 推荐(0)