原创 滑動時候警告:Unable to preventDefault inside passive event listener

移動端Web界面滾動性能優化 Passive event listeners 最近更新了ios11.3,項目上發現這麼一個問題,“我的”頁面和兩個列表頁的滾動出現了問題,滾動時候不僅滾動了希望滾動的部分,整體的頁面也跟隨者上下滾動,整個頁

原创 Xcode10與iOS12 適配以及解決方案

報錯:library not found for -libstdc++.6.0.9 libstdc++、libstdc++.6、libstdc++6.0.9 OpenCV 靜態鏈接 libstdc++   無論是你 C++ 跨平臺編寫,還

原创 You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory

本來準備下載  fastlane 執行了:命令 gem install fastlane --verbose 提示 沒有權限 加上 sudo 輸入密碼就可以了 sudo gem install fastlane --verbose  

原创 關於iOS中延遲執行的幾種方法

原文鏈接:https://www.jianshu.com/p/9ec417d0bf63 1、方法一:使用dispatch_after int64_t delayInSeconds = 10.0

原创 IOS警告imgName' used as the name of the previous parameter rather than as part of the selector

1、多爲傳入多個變量沒有空格引起,在第二變量的冒號前面加個空格既可以解決。 2、可能是前一個變量沒有寫變量名

原创 UIViewContentModeScaleAspectFill不湊效的解決辦法

項目需要在每個cell中添加了照片並分別設置了imageView.contentMode=UIViewContentModeScaleAspectFill; 但是沒想到很多圖片都超出了imageView的frame, 一開始還以爲是co

原创 OC - stringByAppendingPathComponent和stringByAppendingString的區別

1. stringByAppendingString是字符串拼接,拼接路徑時要在名稱前加“/” 2. stringByAppendingPathComponent是路徑拼接,會在字符串前自動添加“/”,成爲完整路徑 兩種方法在拼接同一路徑

原创 文本設置爲兩行,當內容只有一行時,如何讓文本置頂

CGFloat textWidth = [self widthforString: self.localLabel.text fontFor:12]; if (textWidth < self.localLabel.wi

原创 解決duplicate symbols for architecture x86_64編譯錯誤問題

根據提示:提示的:對應兩個下面有相同的聲明修改其中一個 的的名字就好了 把其中一個的planTaskImageView 改一下名字就好了

原创 Objective-C浮點數轉化整數(向上取整、向下取整)

Objective-C拓展了C,自然很多用法是和C一致的。比如浮點數轉化成整數,就有以下四種情況。  1.簡單粗暴,直接轉化 float f = 1.5; int a; a = (int)f; NSLog("a = %d",a); 輸出

原创 iOS數組makeObjectsPerformSelector:SEL方法使用

一. 數組的makeObjectsPerformSelector:SEL方法來減少自己寫循環代碼. [self.answerView.subviews makeObjectsPerformSelector:@selector(remo

原创 UILabel標籤文字過長時的顯示方式

lineBreakMode:設置標籤文字過長時的顯示方式。 label.lineBreakMode = NSLineBreakByCharWrapping; //以字符爲顯示單位顯示,後面部分省略不顯示。 label.lineBre

原创 iOS 報錯 Build input file cannot be found:

Build input file cannot be found: 文件沒有被發現但是Build Pases 裏面copy 卻有。 解決:如圖 第一步找到 第二步:把它刪除重新編譯

原创 昨天定義了一個數組,然後往數組添加數據,結果怎麼打印都是null

知道爲什麼嗎,因爲沒有初始化,尷尬

原创 循環 創建 UIButton 並添加選中狀態 (單選和多選)

自己封裝一個View /在.h聲明 @interface SelectView : UIView @property(nonatomic,assign)NSInteger selectIndex; - (instancetype)ini