0
我無法加載圖像的默認PFCollectionViewCell
。我使用的是PFQueryCollectionViewController
,並且已經正確設置了這些東西 - imageFile除外。抓取PFFile並加載默認PFCollectionViewCell
默認PFCollectionViewCell
有兩個字段:PFImageView
和UILabel
。
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath, object: PFObject?) -> PFCollectionViewCell? {
var cell = collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as? PFCollectionViewCell
if cell == nil {
cell = PFCollectionViewCell()
}
let nom = object as! Nom
cell?.imageView.file = nom.imageFile
println(nom.imageFile) //prints the object id
cell?.imageView.loadInBackground() //nothing actually loads
cell?.textLabel.text = nom.createdBy.name //textlabel is populated properly
return cell
}
- 我能夠填充文本框
- 我無法填充的ImageView
我在做什麼錯?