2

I have a rather complex view layout:

ViewController
- TableViewController inside ContainerView (as child view controller)
  - TableViewCell which holds UICollectionView with subclassed (custom) FlowLayout

When trying to add a UICollectionElementKindSectionHeader supplementary view through my subclassed FlowLayout, I'm getting the following error:

*** Assertion failure in -[MyCollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:], /SourceCache/UIKit_Sim/UIKit-2935.137/UICollectionView.m:1305

Tried solution proposed here: UICollectionView + iOS 7 / Xcode 5 = Assertion Failure but without any luck. I am using Dynamic Auto-Layout Height for my TableViewCells and am wondering if that could have to do w/ it...

Anyone have an idea or could point me in the right direction to troubleshoot? Thanks!

Community
  • 1
  • 1
opfeffer
  • 603
  • 5
  • 19
  • I found this [solutions][1] [1]: http://stackoverflow.com/questions/33253109/ios-error-assertion-failure-in-uicollectionview-layoutsublayersoflayer-in-io , it works fine now – lighter Mar 30 '16 at 10:07

1 Answers1

1

Ugh.. I figured out what was causing the Assertion Failure in my code. Due to my complex nesting of CollectionViews inside of TableViewCells, I wasn't setting the CollectionView's dataSource property before accessing its layout...

opfeffer
  • 603
  • 5
  • 19