CocoaPods常用指令的区别、查找字符串的常见方法、计算总行数\总页数

 1 CocoaPods
 2 - Podfile.lock文件
 3     - 最后一次更新Pods时, 所有第三方框架的版本号
 4 - 常用指令的区别
 5     - pod install
 6         - 会根据Podfile.lock文件中列举的版本号来安装第三方框架
 7         - 如果一开始Podfile.lock文件不存在, 就会按照Podfile文件列举的版本号来安装第三方框架
 8         - 安装框架之前, 默认会执行pod repo update指令
 9     - pod update
10         - 将所有第三方框架更新到最新版本, 并且创建一个新的Podfile.lock文件
11         - 安装框架之前, 默认会执行pod repo update指令
12     - pod install --no-repo-update
13     - pod update --no-repo-update
14         - 安装框架之前, 不会执行pod repo update指令
15 
16 ## 利用SDWebImage设置UIButton的图片
17 - 正确用法
18 [button sd_setImageWithURL:[NSURL URLWithString:url] forState:UIControlStateNormal placeholderImage:image];
19 
20 ## 解决tableView设置tableFooterView时contentSize不正确的问题
21 
22 tableView.tableFooterView = footerView;
23 // 重新刷新数据(会重新计算contentSize)
24 [tableView reloadData];
25 
26 
27 ## 查找字符串的常见方法
28 
29 // 如果range.location == 0, 说明是以searchString开头
30 // 如果range.location == NSNotFound或者range.length == 0, 说明没找到对应的字符串
31 - (NSRange)rangeOfString:(NSString *)searchString;
32 // 是否以str开头
33 - (BOOL)hasPrefix:(NSString *)str;
34 // 是否以str结尾
35 - (BOOL)hasSuffix:(NSString *)str;
36 // 是否包含了str(不管头部\中间\尾部)
37 - (BOOL)containsString:(NSString *)str;
38 
39 
40 ## 计算总行数\总页数
41 
42 总数 : 2476
43 每页显示的最大数量 : 35
44 总页数 :  (2476 + 35 - 1) / 35
45 pagesCount = (总数  +  每页显示的最大数量 - 1) / 每页显示的最大数量
46 
47 总数 : 1660
48 每一行显示的最大数量 : 30
49 总行数 : (1660 + 30 - 1) / 30
50 rowsCount = (总数  +  每行显示的最大数量 - 1) / 每行显示的最大数量

 

posted @ 2016-07-17 15:04  超神船长  阅读(160)  评论(0编辑  收藏  举报