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

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -