title: Infinite Loop of layoutAttributesForElementsInRect
body: <p>I have absolutely zero idea why this is happening, but for whatever reason a collection view I am using is infinitely looping the <code>[UICollectionViewData layoutAttributesForElementsInRect:]</code> method.</p>
  
  <p>The collection view is inside of my custom navigation bar. In one scenario where I use this custom navigation bar, everything works as expected. In another scenario, it loops infinitely.</p>
  
  <ul>
  <li>I have experimented with not setting the data source or delegate on the <code>collectionView</code>.</li>
  <li>I have tried setting the data source and delegate, but returning <code>0</code> for <code>itemsInSection</code>.</li>
  <li>I am using auto layout as in the working situation, and I am initialising the custom navigation bar as in the working situation.</li>
  </ul>
  
  <p>In regard to posting code, I am not sure exactly what to post. The infinite loop begins after <code>[UIWindow makeKeyAndVisible]</code> is called. This method never returns. It was only after time profiling that I discovered that it was this <code>[UICollectionViewData layoutAttributesForElementsInRect:]</code> that was causing the problem.</p>