gpt4 book ai didi

xcode 卡在索引上 变通办法

转载 作者:行者123 更新时间:2023-11-28 12:55:56 28 4
gpt4 key购买 nike

我遇到的问题与之前的问题完全相同 xcode swift indexing forever我发现了我的问题。这个数组:

var VragenInformatie = [[["Spelletjeskamer",""],["Keuken",""],["Garage",""],["Binnenplaats",""],["Zitkamer",""],["Slaapkamer",""],["Studeerkamer",""],["Eetkamer",""],["Badkamer",""]], [["De Wit",""],["Pimpel",""],["Blaauw van Draet",""],["Roodhart",""],["Groenewoud",""],["Van Geelen",""]], [["Loden pijp",""],["Pistool",""],["Engelse sleutel",""],["Dolk",""],["Touw",""],["Kandelaar",""]]]

我试过:清理、删除派生数据,甚至删除工作区之类的东西但没有任何效果。但是我仍然需要这个数组,有人对如何解决这个问题有想法或建议吗?

更新:
我将此数组用于 TableView ,那么 TableView 数据源是否有其他方法?

谢谢您的问候!

最佳答案

我认为,问题出在类型推断上,这对您的 3D 数组来说相当困难。你应该给这个更多的结构,例如通过元组

let VragenInformatie: [[(String, String)]] = [
[("Spelletjeskamer",""), ("Keuken",""), ("Garage",""), ("Binnenplaats",""), ("Zitkamer",""), ("Slaapkamer",""), ("Studeerkamer",""),("Eetkamer",""), ("Badkamer","")],
[("De Wit",""), ("Pimpel",""), ("Blaauw van Draet",""), ("Roodhart",""), ("Groenewoud",""), ("Van Geelen","")],
[("Loden pijp",""), ("Pistool",""), ("Engelse sleutel",""), ("Dolk",""), ("Touw",""), ("Kandelaar","")]
]

无论如何,这不是一个整洁、干净的设计。考虑创建一个结构或类来封装您的数据(抱歉,我的荷兰语不足以理解您尝试向 TableView 提供的内容)。

关于xcode 卡在索引上 变通办法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35044395/

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