I've just got started with RubyMotion and, from what I can tell, it suggests using NSUserDefaults for a datastore. This seems kind of strange to me as the name suggests that it should be only used for storing config variables etc and not objects.
Is it okay to store my objects (such as User, Company, Tasks etc) in NSUserDefaults or should I use another approach?
User defaults are generally OK for storing small amounts of data that does not need encryption. The data which is large or could potentially grow over time should go either into the file system or into Core Data. Anything that needs to be secret (e.g. passwords) must go into keychain.
Here is an answer with suggestions on how to choose among the storage models for your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With