摘要: 由于sdk低于6.0时,dispatch_queue_t ARC没有托管,出现提示错误,修改为: 阅读全文
posted @ 2016-12-05 10:07 杨智帆 阅读(315) 评论(0) 推荐(0) 编辑
摘要: 注意要 -- 注册 xib 2.从xib 创建tableViewCell 可以在创建tableview的时候,直接 注册nib 这样你在- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSI 阅读全文
posted @ 2016-06-17 18:13 杨智帆 阅读(3046) 评论(0) 推荐(0) 编辑
摘要: CocoaPods 安装 阅读全文
posted @ 2016-04-29 09:16 杨智帆 阅读(123) 评论(0) 推荐(0) 编辑
摘要: https 简单理解是 http + ssl 安全协议。 http 协议的问题是,数据在传递的过程中,会经过很多路由,网关等,可能会被恶意的路由器进行数据拦截,篡改等。 https 的通信流程:1.首先确定服务器是经过安全机构认证的,是可信任的。2.通信过程是经过加密的。 1.a. 首先公司向认证机 阅读全文
posted @ 2016-04-23 09:50 杨智帆 阅读(287) 评论(0) 推荐(0) 编辑
摘要: 今天 做代码瘦身,出现cellforrowatindexpath不执行的情况,原因是 在设置自定义类,声明 tableDelegate的时候,没有做强引用,导致 numberOfRows 和 numberOfSection 可以执行,但是cellforrowatindexpath不执行。(在stor 阅读全文
posted @ 2016-04-22 16:52 杨智帆 阅读(1015) 评论(0) 推荐(0) 编辑
摘要: 1.辅助定义复杂的宏,避免引用的时候出错。 例如:#define DOSOMETHING() \ fool1(); \ fool2(); \ 如果在调用的时候写: if (a > 0) DOSOMETHING() 展开之后是: if (a > 0) fool1(); fool2(); 所以,采用do 阅读全文
posted @ 2016-04-15 11:11 杨智帆 阅读(269) 评论(0) 推荐(0) 编辑
摘要: 大致思路: 新建一个DataSource类,把tableView 的数据源代理交给这个类。 核心代码: ViewController中: 新建的ArrayDataSource类: Github 上的实例项目 阅读全文
posted @ 2016-04-12 18:29 杨智帆 阅读(625) 评论(0) 推荐(0) 编辑
摘要: 1. 在子线程添加定时器,必要的时候返回主线程操作 2.把定时添加到当前runloop,并设置model NSRunLoopCommonModes 参考: http://tech.dehengxu.com/blog/timer-hui-diao-shi-jian-bei-uijiao-hu-zu-s 阅读全文
posted @ 2016-03-31 09:39 杨智帆 阅读(362) 评论(0) 推荐(0) 编辑
摘要: https://github.com/zhifanYoung/GYGQRCode 阅读全文
posted @ 2016-03-29 11:15 杨智帆 阅读(201) 评论(0) 推荐(0) 编辑
摘要: __block int timeout = 59; // 倒计时时间 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TY... 阅读全文
posted @ 2016-03-28 15:36 杨智帆 阅读(211) 评论(0) 推荐(0) 编辑