小编rrr*_*abu的帖子

参数标签(forItem:,inSection :)与任何可用的重载都不匹配

我有以下代码段,用于收集视图类别。

func indexPathForCategory(category: Category) -> NSIndexPath
    {
        let section = sections.index(of: category.section)
        var item = 0
        for (index, currentCategory) in categoriesForSection(index: section!).enumerated() {
            if currentCategory === category {
                item = index
                break
            }
        }
        return NSIndexPath(forItem: item, inSection: section!)
    }
Run Code Online (Sandbox Code Playgroud)

在return语句上,由于参数标签(forItem:,inSection :)与任何可用的重载都不匹配,因此出现错误。

uicollectionview swift3

1
推荐指数
1
解决办法
1381
查看次数

标签 统计

swift3 ×1

uicollectionview ×1