我是ios编程的新手,所以感谢您的耐心等待。我正在创建一个集合视图,其中包含从parse.com后端下载的图像和标签。我现在能够在集合视图中完美地显示标签,我也试图获得相应的图像。
我不确定该怎么做。请帮助SOS
这是我的功能
// Get Brands
func getBrand () {
// Create PFQuery
var query:PFQuery = PFQuery(className: "BrandInfo")
// Call findobjects
query.findObjectsInBackgroundWithBlock {
(objects:[AnyObject]?, error: NSError?) -> Void in
// refresh array
self.brands = [String]()
// loop through array
for brandObject in objects! {
// get PFObjects
let brandName:String? = (brandObject as! PFObject)["Name"] as? String
if brandName != nil {
self.brands.append(brandName!)
}
let brandpic:PFFile? = (brandObject as! PFObject)["Image"] as? PFFile