I am working with UICollectionViewController
. When I navigate from a UIViewController
to a UICollectionViewController
by using UINavigationController
an exception occurred with message:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'UICollectionView must be initialized with a non-nil layout parameter.
I don't know why this happened.
I am using a simple UICollectionViewController
without any coding (i.e. by default created file). Its file name is 'NewCollectionViewController.m' & 'NewCollectionViewController.h'.
My Xcode version is 6.1.1.
My navigation code is:
NewCollectionViewController *CVController = [[NewCollectionViewController alloc] init];
[self.navigationController pushViewController:CVController animated:YES];
I just want to navigate from UIViewController
to UICollectionViewController
.