CATiledLayer clears and does not redraw visible tiles

Originator:miles.chris
Number:rdar://15402066 Date Originated:06-Nov-2013
Status:Duplicate Resolved:07-Nov-2013
Product:iOS SDK Product Version:7.0.3
Classification:Serious Bug Reproducible:Always
 
Summary:
When a CATiledLayer on iOS 7 receives a memory warning it clears visible tiles and does not redraw them.

Steps to Reproduce:
1. Create an iOS app containing a scroll view.
2. Add to scroll view a large content view backed by a CATiledLayer.
3. Implement -drawRect: and -drawLayer:inContext: to draw content into tiles, as per Apple Technical Q&A QA1637.
4. Run the project in the Simulator and verify that tiles are drawn as the view is scrolled.
5. Simulate a Memory Warning in the Simulator (if a memory warning does not occur, quit and relaunch the Simulator).
6. Visible tiles may disappear.
7. Scroll the view again. More tiles will disappear.
8. The disappeared tiles are not redrawn, even when visible.

The same problem can be demonstrated on device, although it is more difficult to force a memory warning on demand.


Expected Results:
Only non visible tiles should be purged. Any purged tiles should be automatically redrawn as needed.


Actual Results:
Visible tiles are being purged/cleared. Purged/cleared tiles are not always being redrawn when they are visible again.


Version:
Reproduced on:
iOS 7.0.3 (11B508)
iOS 7.0 (11A465)



Notes:
A project demonstrating the problem has been attached. Run the project in an iOS 7 iPhone Simulator and follow the steps above to reproduce the problem.

This problem is also being reported by multiple people in the dev forums https://devforums.apple.com/message/914840#914840 and https://devforums.apple.com/message/884804#884804


Configuration:
The problem is reproducible on iOS 7 Simulator and iOS 7 devices (iPhone 5s, iPod Touch 5G, for example).
The same code running on iOS 6.0 and 6.1 Simulators does not show any problems. Works as expected on iOS 6.



07-Nov-2013
Duplicate of 14940662

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!