CocoaPods
- Podfile.lock文件
- 常用指令的區(qū)別
- pod install
- 會根據(jù)Podfile.lock文件中列舉的版本號來安裝第三方框架
- 如果一開始Podfile.lock文件不存在, 就會按照Podfile文件列舉的版本號來安裝第三方框架
- 安裝框架之前, 默認會執(zhí)行pod repo update指令
- pod update
- 將所有第三方框架更新到最新版本, 并且創(chuàng)建一個新的Podfile.lock文件
- 安裝框架之前, 默認會執(zhí)行pod repo update指令
- pod install --no-repo-update
- pod update --no-repo-update
- 安裝框架之前, 不會執(zhí)行pod repo update指令
利用SDWebImage設(shè)置UIButton的圖片
[button sd_setImageWithURL:[NSURL URLWithString:url] forState:UIControlStateNormal placeholderImage:image];
解決tableView設(shè)置tableFooterView時contentSize不正確的問題
tableView.tableFooterView = footerView;
// 重新刷新數(shù)據(jù)(會重新計算contentSize)
[tableView reloadData];
查找字符串的常見方法
// 如果range.location == 0, 說明是以searchString開頭
// 如果range.location == NSNotFound或者range.length == 0, 說明沒找到對應(yīng)的字符串
- (NSRange)rangeOfString:(NSString *)searchString;
// 是否以str開頭
- (BOOL)hasPrefix:(NSString *)str;
// 是否以str結(jié)尾
- (BOOL)hasSuffix:(NSString *)str;
// 是否包含了str(不管頭部\中間\尾部)
- (BOOL)containsString:(NSString *)str;
計算總行數(shù)\總頁數(shù)
總數(shù) : 2476
每頁顯示的最大數(shù)量 : 35
總頁數(shù) : (2476 + 35 - 1) / 35
pagesCount = (總數(shù) + 每頁顯示的最大數(shù)量 - 1) / 每頁顯示的最大數(shù)量
總數(shù) : 1660
每一行顯示的最大數(shù)量 : 30
總行數(shù) : (1660 + 30 - 1) / 30
rowsCount = (總數(shù) + 每行顯示的最大數(shù)量 - 1) / 每行顯示的最大數(shù)量
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者