0
我實在不明白這一點:發現零可選值?
print(module)
print(Globals.sharedInstance.dataModuleName)
let kind:NSString = module[Globals.sharedInstance.dataModuleName] as! NSString
將打印這一點,然後崩潰了奇怪的理由:
(//dic print
{
meta = no;
module = IN;
subject = LT;
variable = A2;
}
)
module // print the right field we are looking for inside the dictionary .
fatal error: unexpectedly found nil while unwrapping an Optional value
但是你可以看到這個模塊是一個有效的字典和也dataModuleName
。
碰到線let kind
。它出什麼問題了 ?
非常感謝,但我檢查了這一點,它的字典,我創建了一個名爲與var數據的數據字典:NSMutableDictionary = [:] – Curnelious
它打印它的方式是數組字典,嘗試一次我的答案。 –
對不起,這很對,非常感謝!會讓我接受。 – Curnelious