I had a similar cache issue that needed to be flushed to the server instead of the local database. I used the tools to find the “typical” size of one of the cached objects (I had pretty unified ones), and I just support counting in the cache, and when I cross the threshold I free my cache on the server. Then I found out about NSCache, which has a lot of the same behavior. I explored ways to dynamically size each object in the cache, but found it tedious and fragile.
Basically, I think you need to decide what makes sense from your application based on the usage characteristics collected with the tools. I found a video from the 2011 WWDC conference “Section 318 - iOS in depth performance” to be very useful for such situations. You can find it on itunes U.
source share