Well this is all cool, but I don't think it's good in most cases. iPhone ships with NAND Memory built in which slowly dies-as-you-readwrite. I found good approach in "Advanced iPhone Projects" published Apress:
Quote:
With the iPhone’s NAND flash memory, writing is expensive both in terms of speed and in terms of hardware lifetime. It will eventually wear out with use. Apple recommends that you write to disk only when necessary. Since our application checks to see whether the data is stale, it is unlikely to download stock data more than once or twice per day, so you can reasonably store it to disk when it arrives. If your data were more often malleable, you might consider storing it only when the application closes or if you ran out of memory. In gogoDocs[Their App], we only download and write the updated feed if its last changed date is later than that of our cached information. This keeps the application from making unnecessary writes to the flash memory. Apple supplies a convenience method in your application’s delegate where you can save data before the app closes:
Code:
-applicationWillTerminate:
|