Posts

Showing posts from September, 2012

NSUserDefaults

For storing data in iOS Device we have some options like NSUserDefaults, Plist file, Sqlite, Core Data. Depending on our reqirement we switch on one of the option amongst these. NSUserDefaults   - We store users preferences and settings here. Plist File                - We store data in Plist if we dont have large data to persist. We store data in key-value pair.  Core Data             - We store anything which we want to persist, we can execute predicated, fetch requests to retrieve data. SQLite                   - We store anything which we want to persist, we can execute more complex queries directly to Database to fetch data/ Actually NSUserDefaults is a Plist file. NSUserDefaults will store the users preferences into a Plist file into the Library/Preferences folder. So we can store whatever we can store in a Plist file. There is no restriction on size of a Plist File. But one thing you might not forget is that when you store or read data in a Plist file whole contents