小编Ibr*_*rar的帖子

在 iOS swift 5 中获取 LAN 上的设备及其主机名和 IP 地址的列表

我正在尝试获取局域网上连接设备的详细信息,例如FingiNet。我尝试过一些库:MMLanScanLAN-Scan并获取了 IP 地址,但无法获取主机名。如果有人以前经历过这个,请分享。谢谢。

ip lan hostname ios swift

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

UITableView重复单元格(带有文本字段的自定义单元格)

我花了几天时间来解决这个问题,经过多次努力,我在这里问一个问题.我正在使用自定义UITableViewCell,该单元格包含UITextFields.在向表视图添加新单元格时,表格视图表现异常,就像复制单元格一样,当我尝试编辑新单元格的文本字段时,前一个单元格的文本字段也会被编辑.

重复的行为如下:第一个单元格被复制为第三个单元格.我不知道这是由于细胞的可重用性,但有人能告诉我有效的解决方案吗?

我附上了UITableViewCell的截图.

自定义UITableViewCell

cellForRow的代码如下:

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    let cell : Product_PriceTableViewCell = tableView.dequeueReusableCell(withIdentifier: "product_priceCell") as! Product_PriceTableViewCell

    cell.dropDownViewProducts.index = indexPath.row
    cell.txtDescription.index = indexPath.row
    cell.tfPrice.index = indexPath.row
    cell.dropDownQty.index = indexPath.row
    cell.tfTotalPrice_Euro.index = indexPath.row
    cell.tfTotalPrice_IDR.index = indexPath.row
    cell.dropDownViewTotalDiscount.index = indexPath.row
    cell.dropDownViewDeposit.index = indexPath.row
    cell.tfTotalDeposit_Euro.index = indexPath.row
    cell.tfRemaingAfterDeposit_IDR.index = indexPath.row

    return cell
}
Run Code Online (Sandbox Code Playgroud)

uitableview ios swift

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

标签 统计

ios ×2

swift ×2

hostname ×1

ip ×1

lan ×1

uitableview ×1