On one hand, I'm just curious.
On the other, I have to count somehow the amount of images created (to trigger cleanup at some quantity). Unfortunately memory warnings notify me too late, the app gets terminated before I have any chance to react, so thatswhy I want to work this issue around.
I could scatter around my project with a global counter, that increments before I make any UIImage operation, but obviously this is exactly what I want to avoid, that would result in an unmaintainable design.
So I was thinking about subclass UIImage initializers (some kind of MYImage class), than use MYImage troughout the project, but UIImageView's would use UIImages anyway (maybe I can set UIImageView's setImage method, but I bet UIKit uses actual _image instance variable at many cases).
The best would be to count pixels amount from UIImage sizes, so I could flush image memory above a given pixelcount.
Any notification? Something trough categories? Or some kind of NSObject KVO observing (with literal checkings on class/method names)? Do you have ideas/experiences?