我正在制作一个可点击的集合视图来导航下一个视图控制器,但没有数组传递给collectionview单元格,但是编译器读取它。我想要在集合视图中使用模型类的plist帮助。
override func viewDidLoad(){
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
if let path = Bundle.main.path(forResource: "NokiaList", ofType: "plist"){
if let dict = NSDictionary(contentsOfFile: path){
print(dict)
self.arrproducts = NSMutableArray(array: dict.value(forKey: "arrproducts") as! NSArray)
}
let product = ProductsDetails()
let dict = self.arrproducts.object(at: 0) as! NSDictionary
product.Name = dict.value(forKey: "Name") as! String
product.Image = dict.value(forKey: "Image") as! String
product.Status = dict.value(forKey: "Status") as! String!
let arr = NSMutableArray()
arr.add(product)
let productNew = arr.object(at: 0) as! ProductsDetails
productNew.Status = "yes"
arr.removeObject(at: 0)
arr.insert(productNew, at: 0)
self.CollectionViewOutlet.reloadData()
}
}