Welcome to the Treehouse Community
Looking to learn something new?
Is it possible to use database without some service like parse.com ?
All the classes we end up using some service like parse.com but nobody ever talks about using local databases. Is it possible? How it's done?
Susanna Remec12,316 Points
Hi Fernando, Yes local data bases are very possible given that your data is a smallish set. You can load a JSON or XML file with the app bundle and access it with the appropriate parser. Just point the parser at your onboard file instead of a URL. Another way is to use Core Data- i think Apple prefers this method and it is capable of much more complex data retrieval. Core Data is a bit harder to wrap your brain around at first but it is worth the effort to learn. There is a video or two on Treehouse that cover the basics. Good Luck!
Patrick Cooney12,216 Points
There are also several database options available for the iPhone. You can use sqlite3 without needing Core Data. There are several wrappers out there to make using sqlite3 easier and to prevent you from having to write raw SQL. You can find a lot of them on github. There is also a notable new database called Realm that you can check out. They have both an Objective-C and Swift version.