【发布时间】:2017-11-30 18:33:15
【问题描述】:
如果字符串 i
无法使用类型参数列表调用类型“Int”的初始化程序 '([字符串])'
请帮忙。
var percent_change_24hArray = [String]()
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cell") as! TableViewCell
let PercentInt = Int(percent_change_24hArray)
if PercentInt < 0 {
cell.procentLabel.textColor = UIColor.red
}
cell.procentLabel.text = "\(percent_change_24hArray[indexPath.row])%"
return cell
}
【问题讨论】: