2
我試圖使用從迅速向propriety list
讀,但即時得到這個錯誤,並使用從我plist
讀那代碼IM:意外地發現零而展開的可選值 - 的plist
陣列我使用:
var recipeNames :[String] = []
var recipeImages :[String] = []
var recipeTime :[String] = []
在viewDidLoad中:
var path = NSBundle.mainBundle().pathForResource("recipes", ofType: "plist")
var dict = NSDictionary(contentsOfFile: path!)
recipeNames = dict!.objectForKey("name")! as! [String]
recipeImages = dict!.objectForKey("image")! as! [String]
recipeTime = dict!.objectForKey("time")! as! [String]
沒有的plist本身,它是有點兒很難說什麼是錯... – Miknash
我正在嘗試答案,如果它沒有工作,我會上傳我的plist的截圖。@ NickCatib –