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:

enter image description here

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

Popular posts from this blog

javascript - Trigger mouseenter when an animated element touches mouse -

json - Zend error Connection -

java - Using Spring @Transactional with a combination of readOnly and write, when does this entity get committed? -