【问题标题】:Editor placeholder in source file swift [duplicate]源文件中的编辑器占位符 swift [重复]
【发布时间】:2019-04-30 21:14:15
【问题描述】:

This happened to me please help me please,Thank you.

这里的代码:

func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MenuCollectionViewCell", for: IndexPath) as! MenuCollectionViewCell

        return cell
    }

image here 点击“这件事发生在我身上,请帮帮我。谢谢。”查看图片。

【问题讨论】:

    标签: ios swift xcode compiler-errors


    【解决方案1】:

    你需要这样写:

    func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "MenuCollectionViewCell", for: indexPath) as! MenuCollectionViewCell
        return cell
    }
    

    【讨论】:

    • 我像你一样编辑它,但它仍然有错误
    • 不是索引路径。索引路径
    • 非常感谢!
    猜你喜欢
    • 2017-05-04
    • 2016-09-18
    • 1970-01-01
    • 2020-02-22
    • 1970-01-01
    相关资源
    最近更新 更多