Reputation: 21
I'm using CocoaPods with SDWebImage (3.8.2) with a new Swift 3 project (XCode Version 8.2.1 (8C1002)) and the following code compiles fine within a UICollectionViewController:
override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
...
cell.customImageView.sd_setImage(with: imageURL, completed:{
(SDWebImageCompletionBlock) in
})
...
}
I've imported SDWebImage at the top of the swift file. customImageView is a UIImageView defined within a custom UICollectionViewCell
@IBOutlet weak var customImageView: UIImageView!
however this crashes on run with the following error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView sd_setImageWithURL:completed:]: unrecognized selector sent to instance ...'
Any ideas why this is compiling fine but crashing at runtime?
Upvotes: 0
Views: 492
Reputation: 344
Check the outlet, disconnect and reconnect the outlet of your imageView
Upvotes: 0
Reputation: 125
Add $(inherited)
to your 'Other Linker Flags' in the build settings
Upvotes: 1