title: iPhone layer management - best practice
body: <p>Louis - Thanks for your input. Here is what I did, and my current issues, which i don't understand.</p>
  
  <p>The menus (2) are UIImageViews that respond to touch. Each is it's own class. The 'sprites' as you called them also respond to touch.</p>
  
  <p>In the .m where I add the menus and sprites to the layer, I created two container layers, via this code: menuContainer = [CALayer layer].</p>
  
  <p>I ordered them with the menuContainer above the spriteContainer. Now, the sprites do move below the menus - great! But in the process, the sprites stopped responding to touch (I can understand this as they are below the menuContainer layer), and the menus stopped responding to touch as well (don't get that). Continuing to confuse the situation, a layer added to the menuContainer that responds to a multitouch gesture by popping up a slider still reads the multitouch and pops up the slider, but I can't slide the slider. This has me thoroughly confounded.</p>
  
  <p>Thanks.</p>
  
  <p>My app is building a background layer, then building some menu layers that should always be at the top.
  After this, I add many moving layers and remove many moving layers very quickly.</p>
  
  <p>My problem is I want my menu layers (there are 4) to always be in front of the other layers. I have thought of building a layer hiearchy and using the insertsublayer: atindex: method, making my menus a notional index of 1000, and inserting the multitude of moving layers at a lower index, like 200.  If I insert one layer at 200 and then the next at 200, does the first layer that was assigned to 200 get shifted (to 201) or does it get blown away?</p>
  
  <p>I have tried inserting the layers with the insertsublayer: below:, but that does not give me the desired results.</p>
  
  <p>Thanks for the help.</p>