Which data saving method i use?
Hi i am making an app which will save data(say... time,location ,etc) many times in a day
NOW i have to maintain full history of this...for months
SO i was asking which data saving 开发者_StackOverflow社区type i use
sqlite database or NSUserDefault (i am aware of only these 2)
or is there any other method?
Thank you
You could abstract all of this away using Core Data. You are right that you still need to decide on which backing store to use (flat file, xml, sqlite). xml is human readable which is good for debugging, but for the large amount of data you will have, sqlite will be much faster.
http://developer.apple.com/library/ios/#documentation/DataManagement/Conceptual/iPhoneCoreData01/Introduction/Introduction.html
Sqlite is easy to everyone have some database knowledge.
Core data need much time to learn, but when you know it, use it is more easy than Sqlite.
NSUserDefault only use to save some small data, like configuration data.
You can use sqlite and core data for your database.
use of NSUserDefault is not proper in case of large database. NSUserDefault uses with little amount of data (such as passcode ).
精彩评论