4 ms·
Yes, it does take advantage. As of OS version 3, if an image is not retained by anything other than the UIImage named image cache and the app receives a low me
by kenferry 16y ago
Yes, it does take advantage. As of OS version 3, if an image is not retained by anything other than the UIImage named image cache and the app receives a low memory warning, the in-memory image is destroyed.
-Ken (Cocoa Frameworks)
- masklinn 16y agoAnd this is clearly and publicly documented behavior, as quoted (but not linked) by swift above: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImage_Class/Reference/Reference.html%23//apple_ref/doc/uid/TP40006890-CH3-SW2 http://developer.apple.com/library/ios/#documentation/uikit/... > In low-memory situations, image data may be purged from a UIImage object to free up memory on the system. This purging behavior affects only the image data stored internally by the UIImage object and not the object itself. When you attempt to draw an image whose data has been purged, the image object automatically reloads the data from its original file.
- kenferry 16y agoThat's actually separate. That's talking about a UIImage purging data, but in this case, it's the entire UIImage that is discarded from the cache that holds UIImages indexed by name.
- masklinn 16y agoOh ok, I had missed that part. So the purging can happen at both level, within the UIImage (which discards its data when it's linked to a file) and within a cache holding a UIImage (which discards the UIImage itself)? (the former seemed to match the described case exactly, which is probably why I missed the difference, sorry)