I have an app that looks like this:
ViewController
is the parent VC into which I placed 3 container view controllers.
I subclassed UIViewController
for all three, Top, Mid & BottomContainerViewControllers.
Here is my question. I want the BottomVC
to have a UICollectionView
which scrolls sideways. So I added a UICollectionView
as you can see (gave it a nice greenish background).
But my question is, how do I hook this up?
This is my BottomContainerViewController.h:
#import <UIKit/UIKit.h>
@interface BottomContainerViewController : UICollectionViewController <UICollectionViewDataSource, UICollectionViewDelegate>
@property (nonatomic, retain) IBOutlet UICollectionView *collectionView;
@end
And the .m file has the following methods:
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
But when I run it I get:
[UICollectionViewController loadView] loaded the "qcP-Hl-Txn-view-aJq-Dc-875" nib but didn't get a UICollectionView.'
The UICollectionView
outlet is connected. What else could be the problem?