【发布时间】:2017-04-11 19:55:34
【问题描述】:
我在 tableview 的 viewforHeaderInSection 方法中应用了以下代码。检查dictkey >= 3时出现错误:
二元运算符“>=”不能应用于“Any”和“Int”类型的操作数
else if finalDict.count > 0 {
print(section)
let dictKey = selectedValueArray[section]
print(dictKey)
if self.finalDict.object(forKey: String(describing: dictKey)) != nil {
let diaryRowArray = self.finalDict.object(forKey: String(describing: dictKey)) as! NSArray
print(diaryRowArray.count)
print(diaryRowArray)
if dictKey >= 3
var tempsection = section
tempsection = 0
let diarydescription = diaryRowArray[tempsection] as! DiaryModel
headerLabel.text = diarydescription.diary_category_name
print(headerLabel.text!)
}
}
}
【问题讨论】:
-
你还有问题还是已经解决了?
-
不,问题解决了。谢谢
-
好的,如果其中一个为您解决了问题,您应该将答案标记为正确。