我做了一個數組:陣副本顯示0 1,而不是真正的假斯威夫特
var hugett = [[[true, false], [true, true], [true, true, true], [true, true, false, false], [false]],[]]
以及陣列中取得的第一個索引的副本:
tempott = hugett[0]
BUT!當我打印我得到不同的結果,當我打印原始數組(hugett
):
[[true, false], [true, true], [true, true, true], [true, true, false, false], [false]]
當我打印副本(tempott
),這是我得到:
((
(
1,
0
),
(
1,
1
),
(
1,
1,
1
),
(
1,
1,
0,
0
),
(
0
)
))
相反向我展示真假 - 我的錯誤是0/1?
我用印刷品打印: print(tempott)。 但問題不在於打印,問題是我需要使用tempott與true和false,因爲0/1我不能。 – Eliko
'我用print打印:print(tempott)'對不起,但用'print'打印時我得到的是true和false,而不是0和1.我不能在Playground中重現你的問題。你必須對某件事感到困惑,請檢查你的代碼。 – Moritz
你是怎麼創建你的tempott的? – Eliko