我正在尝试在滚动视图中放置一个PFQueryCollectionView,但它一直在崩溃时出现此错误[UICollectionViewController loadView] instantiated view controller with identifier "first" from storyboard "Main", but didn't get a UICollectionView.'
单元格标识符以及storyboard id是正确的。我想我知道出了什么问题。它试图将视图控制器放在滚动视图中,而是检索PFQueryCollectionView类。
滚动视图
override func viewDidLoad() {
super.viewDidLoad()
let page: pageone = self.storyboard?.instantiateViewControllerWithIdentifier("first") as! pageone
收藏视图
class pageone: PFQueryCollectionViewController{
override func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath, object: PFObject?) -> PFCollectionViewCell? {
var cell: PFCell = collectionview.dequeueReusableCellWithReuseIdentifier("cell", forIndexPath: indexPath) as! PFCell
cell.name.text = object!["Name"] as? String
return cell
}
}