Reputation: 33
Based on the SimpleCollectionView sample, I have successfully add CollectionViewController into ViewController but I get an error when I clicked on the items in the CollectionViewController. Below are the codes for references.
UICollectionViewController simpleCollectionViewController;
public override void ViewDidLoad()
{
base.ViewDidLoad();
simpleCollectionViewController = new SimpleCollectionViewController(new LineLayout());
View.AddSubView(simpleCollectionViewController.View);
}
Really hope someone willing to guide me on this.
Upvotes: 3
Views: 78
Reputation: 81
That is because your controller has been released just try this
//self is the base controller
[self addChildViewController: simpleCollectionViewController];
Upvotes: 1