swift - My iOS app cannot locate my plist in code -
i doing this tutorial
there plist in provides datasource collectionview data. have plist in folder called resources:
the name property of plist items name of images displayed, why names not correspond fruit, images of clothing icons. function here not make past first if statement. why be?
func populatedata() { if let path = nsbundle.mainbundle().pathforresource( "fruits", oftype: "plist") { if let dictarray = nsarray(contentsoffile: path) { item in dictarray { if let dict = item as? nsdictionary { let name = dict["name"] as! string let group = dict["group"] as! string let fruit = fruit(name: name, group: group) if !contains(groups, group){ groups.append(group) } fruits.append(fruit) } } } } }
Comments
Post a Comment