iOS开发(swift 5)开发过程中遇到的问题汇总(持续更新)


1.用 Kingfisher 加载网络图片的时候报错: “No exact matches in call to instance method 'setImage'”

image.png

这个错误是出在url的写法上了

// 错误写法
let url = "http://222.75.166.203:40920/resources/user/avatar_7.jpg"
// 正确的写法
let url = URL(string: "http://222.75.166.203:40920/resources/user/avatar_7.jpg")
imageView.kf.setImage(with: url)

你可能感兴趣的:(iOS开发(swift 5)开发过程中遇到的问题汇总(持续更新))