gpt4 book ai didi

swift - WKInterfaceTable 未加载值

转载 作者:行者123 更新时间:2023-11-30 11:10:00 25 4
gpt4 key购买 nike

我正在从 iOS 应用程序发送的上下文中加载接口(interface)表值。数据传递成功但是tableview方法

rowController(at: index)

返回零在代码行之后,Value 和 numberOfRows 变量仍然为 0

tableView.setNumberOfRows(3, withRowType: "deviceRow")

我的整体代码是

func setupTable() {
tableView.setNumberOfRows(devicesArray.count, withRowType: "deviceRow2")

for (index, device) in self.devicesArray.enumerated() {
if let row = tableView.rowController(at: index) as? MeasurementCell {

row.deviceNameLabel.setText(device)
row.readingLabel.setText(self.readingsArray[index])
let statusColor = colorWithHexString(hex: self.colorsArray[index])
// row.backgroundGroupView.setBackgroundColor(statusColor.withAlphaComponent(0.2))
row.readingLabel.setTextColor(statusColor)
row.dateLabel.setText(self.datesArray[index])
row.readingLabel.setTextColor(self.getColor(fromString: self.colorsArray[index]))
row.readingLabel.sizeToFitWidth()
}
}

这个问题有解决办法吗?建议受到高度重视。

最佳答案

在interfaceController的身份检查器中

原来是

enter image description here

当我进行如下所示的更改时,它通过苹果魔法起作用了enter image description here

不知道此修复程序如何发挥作用背后的原因。希望以后有人能帮助回答这个问题。

关于swift - WKInterfaceTable 未加载值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52272519/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com