title: Removing all CALayer's sublayers
body: <p>I have trouble with deleting all of layer's sublayers. I currently do this manually, but that brings unnecessary clutter. I found many topics about this in google, but no answer.</p>
  
  <p>I tried to do something like this:</p>
  
  <pre>
  for(CALayer *layer in rootLayer.sublayers)
  {
      [layer removeFromSublayer];
  }
  </pre>
  
  <p>but it didn't work.</p>
  
  <p>Also, i tried to clone rootLayer.sublayers into separate NSArray, but result was the same.</p>
  
  <p>Any ideas?</p>
  
  <p>Edit:</p>
  
  <p>I thought it works now, but I was wrong. It works good with CALayers, but it doesn't work with CATextLayers. Any ideas?</p>