Cache UIView on drive?
does anyone know if it's possible to cache the entire UIView on a drive not i开发者_如何学Cn memory so you don't have to regenerate the entire content everytime you want to access it ... Right now I am preloading three pages on both sides in scroll view but it would be nice to pregenerate the entire edition in background and store it in documents directory.
Have a look at Erica Sadun's developer cookbook pages 311-316 on adding persistence to direct manipulation interfaces and in particular, persistence through archiving which does exactly what you are wanting.
The core of this is use of NSKeyedArchiver and NSKeyedUnarchiver which will let you persist an object into a file.
I haven't done this myself yet, but I remember reading it at the time and thinking it could be very useful for exactly your situation.
If the view is static then you may save it as image.
精彩评论