UICollectionViewController nested in a normal UIViewController

Posted by patrickS on Stack Overflow See other posts from Stack Overflow or by patrickS
Published on 2013-10-18T15:49:57Z Indexed on 2013/10/18 15:54 UTC
Read the original article Hit count: 355

Filed under:
|
|

I have added a UICollectionView into a normal ViewController (MainViewController), and than created a UICollectionViewController Subclass (CollectionViewController) in the ViewController and connected the UICollectionView outlet with the CollectionViewController object

_collectionViewController = [[CollectionViewController alloc] initWithCollectionViewLayout:_collectionView.collectionViewLayout];

_collectionView.dataSource = _collectionViewController;
_collectionView.delegate = _collectionViewController;

In the CollectionViewController I have setup an simple NSArray object and I show this one. This works as expected. But If I try to access the collectionview from the CollectionViewController via self.collectionview I am not able to access this one.

I dont know what I have to do, to also connect the collectionview.

I have build a sample ios-app it is available at: https://github.com/patricks/uicollectionview-problem

The method - (void)outputSelectedCell in the UICollectionViewController always shows, that there is nothing selected…

I hope you understand the problem.

© Stack Overflow or respective owner

Related posts about ios

Related posts about objective-c