1、warning:Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int
解决方案:target->BuildSetting -> Other Warning Flags 中添加
-Wno-shorten-64-to-32
2、cocopods去除三方库的警告
解决方案:podfile中添加
inhibit_all_warnings!
3、warning: The image set name xxx is used by multiple image sets.
原因:Assets.xcasset中出现了两张同名,或者在不同文件夹中重复添加了
解决方案:删除同名文件即可
4、warning:'substring(from:)' is deprecated: Please use String slicing subscript with a 'partial...
原因:swift3废除了substring(from:)、substring(to:)、substring(with:)三个方法
解决方案:
str.substring(from:index)替换为:let newStr = String(str[..<index])
str.substring(to:index)替换为:let newStr = String(str[index...])
str.substring(with:range)替换为:let newStr = String(str[range])
5、warning:Implicit conversion loses integer precision: 'unsigned long' to 'CC_LONG' (aka 'unsigned int').
解决方案:
CC_MD5(str,strlen(str), r);,
改成了
CC_MD5(str,(CC_LONG)strlen(str), r);