2015年8月11日

(一一八)利用block实现链式编程

摘要: 有些时候需要不断地调用方法,如果使用传统方案,需要拿到对象多次调用,例如有一个Ball对象,实现了up、down、left、right四个方法,分别控制球的运动方向,如果要实现球向右再向下,需要这么写: [ball right];[ball down];如果能够按照下面这样写,会更加方便。 [[... 阅读全文

posted @ 2015-08-11 22:26 张大大123 阅读(141) 评论(0) 推荐(0) 编辑

(一一七)基本文件操作 -SDWebImage清除缓存 -文件夹的大小计算

摘要: 在iOS的App沙盒中,Documents和Library/Preferences都会被备份到iCloud,因此只适合放置一些记录文件,例如plist、数据库文件。缓存一般放置到Library/Caches,tmp文件夹会被系统随机清除,不适宜防止数据。 【图片缓存的清除】 在使用SDWebIm... 阅读全文

posted @ 2015-08-11 22:16 张大大123 阅读(217) 评论(0) 推荐(0) 编辑

1085. Perfect Sequence (25) -二分查找

摘要: 题目如下: Given a sequence of positive integers and another positive integer p. The sequence is said to be a "perfect sequence" if M #include #includ... 阅读全文

posted @ 2015-08-11 14:27 张大大123 阅读(171) 评论(0) 推荐(0) 编辑

1083. List Grades (25)

摘要: 题目如下: Given a list of N student records with name, ID and grade. You are supposed to sort the records with respect to the grade in non-increasing... 阅读全文

posted @ 2015-08-11 14:17 张大大123 阅读(159) 评论(0) 推荐(0) 编辑

导航