【发布时间】:2017-05-04 12:23:36
【问题描述】:
您遇到快速错误“源文件中的 Swift 编辑器占位符”的问题 这是我的代码
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell{
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: <#T##IndexPath#>) as! CustomBrandCell
let brandImage: UIImage = UIImage(named: self.brands[indexPath.row].name)!
cell.brandImageView.image = brandImage
return cell
}
【问题讨论】:
-
你搜索过SO吗?
-
看看这里,例如:stackoverflow.com/questions/37352738/…。在您的情况下,问题出在
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "Cell", for: <#T##IndexPath#>) as! CustomBrandCell这一行。注意 ,它是一个占位符,您必须用一些“真实”代码替换它...在您的情况下是indexPath类型的参数 -
错误非常很简单,第二行有一个明显的占位符。我已投票以“一个简单的印刷错误”结束这个问题。
标签: ios swift placeholder