1、自己導(dǎo)入文件到項(xiàng)目后使用報(bào)錯(cuò) 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter' ? 找不到文件
2、 點(diǎn)擊電池條scrollView會(huì)滾動(dòng)到頂部,解決方法tableView.scrollsToTop = NO
3、關(guān)于里添加appstore評(píng)分入口 參照微博 [[UIApplicationsharedApplication]openURL:[NSURLURLWithString:@"http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=APPID&pageNumber=0&sortOrdering=2&type=Purple+Software&mt=8"]];(APPID可在itunce里面查到)
4、ios 11 tableView Group下 直接通過代理設(shè)置header和footer高度沒效果 必須要實(shí)現(xiàn)- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section { ? ?return nil;}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { ? ?return nil;} 兩代理方法
5、沒有navi情況下tableView下移,解決方法:
if ([self respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
? ? ? ? if (@available(iOS 11.0, *)) {
? ? ? ? ? ? self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
? ? ? ? } else {
?? ? ? // Fallback on earlier versions
? ? ? ? }
? ? }
6、iOS 自帶懸浮調(diào)試框,參考http://swift.gg/2017/05/27/ui-debugging-information-overlay/#more
7 關(guān)于啟動(dòng)頁
一. 用 LaunchScreen.storyboard方式添加啟動(dòng)頁1,跑一下程序,App啟動(dòng)頁為1,然后更換啟動(dòng)頁為2
? ? 1.啟動(dòng)頁更換為LaunchImage方式,跑一下程序,app啟動(dòng)頁為1.不成功
? ? 2.啟動(dòng)頁更換為LaunchImage和?LaunchScreen.storyboard,跑一下程序,黑屏。不成功
? ? 3.直接更換?LaunchScreen.storyboard的圖片,跑一下程序,app啟動(dòng)頁為2.成功
二.用 LaunchScreen.xib方式添加啟動(dòng)頁1,跑一下程序,App啟動(dòng)頁為1,然后更換啟動(dòng)頁為2
? ? 1.啟動(dòng)頁添加方式更換為LaunchImage方式,跑一下程序,app啟動(dòng)啟動(dòng)頁為1。不成功
? ? 2.啟動(dòng)頁添加方式不更換,跑一下程序,app啟動(dòng)頁為1。不成功
? ? 3..啟動(dòng)頁更換LaunchScreen.storyboard,跑一下程序,app啟動(dòng)頁為2。成功
三.用LaunchImage方式添加啟動(dòng)頁1,跑一下程序,app啟動(dòng)頁為1,然后更換啟動(dòng)頁為2
? ? 1.啟動(dòng)頁添加方式不變,跑一下程序,app啟動(dòng)頁為2。成功
? ? 2.啟動(dòng)頁添加方式換為LaunchScreen.xib,跑一下程序,app啟動(dòng)頁為2。成功
? ? 3.啟動(dòng)頁添加方式換為LaunchScreen.storyboard,跑一下程序,app啟動(dòng)頁為2。成功
8、?關(guān)于URL Scheme(廣告、活動(dòng)、推廣用的較多)
9、label設(shè)置attributedText后,超出寬度部分不會(huì)用省略號(hào)(...)而是直接將文字截?cái)嘞聢D: ?

設(shè)置label的_actorsLabel.lineBreakMode = NSLineBreakByTruncatingTail(結(jié)尾部分的內(nèi)容 以……方式省略)即可顯示省略號(hào):

10、xcode。rename failed
Go to?~/Library/Developer/Xcode/DerivedData?and remove folder contents including "ModuleCache".