It looks like [1] the CollectionView
property is null
at this point of time - i.e. when inside the constructor of your TestViewController
type.
It is likely set (by iOS) to a valid (non-null) value later (e.g. when ViewDidAppear
is called). In that case you should move your call to RegisterNibForCell
later in the execution.
[1] you can use the debugger to see the values of any fields/properties.