I heard that apple changed some things, concerning the memory management in iOS 5. So where is the best place, to save app data and files in my new iOS 5 application - without losing data?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
I believe you can save data in either
Caches
orDocuments
ortmp
directories. The former 2 are actually backed by (i.e. data backup) by iTunes automatically when you connect to it.For example this code accesses the
Caches
directory -You can experiment with either
Documents
ortmp
in similar fashion. Hope this helps...To add to what @Srikar have said, only save data in Caches if you can regenerate it. It has been found that when the device is running short on memory it clears off the app's cache directory. This has been confirmed on various blog post and developers.
if it's iOS5 only consider using iCloud. For local storage iOS sandbox hasn't changed much, NSDocumentsDirectory (which is backed up to iTunes).