Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I am developing an app where I am going to use NSUserDefaults to store some profile variables (name, picture, etc), I think.
I think I need to store some long huge lists of values for each user and I read about Parse and Core Data. What is the best? Can Parse replace Core Data?
What is useful on this case? Both?
Thanks in advance
Parse will store your data on their infrastructure on the cloud. You can enable Parse object caching to keep that data for offline use as well. For most apps I build, I avoid using CoreData (although Parse may be internally using some for of local store, could be CoreData) and use Parse explicitly with caching.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm developing an iOS app that is going to parse XML from an RSS feed of events and display the details of each event on a table view. Each event has a title, a description (optional), a date and a time. I am able to parse the XML data using NSXMLParser; however, I am not sure how I should store the data and make it so that it persists after the app is closed.
I have read that I can use NSCoder to persist the data but I am not sure if this is the best route forward.
Does anyone have any ideas or suggestions as to what I could do?
Any help is appreciated.
You have several options for persisting data.
NSUserDefaults are meant for user settings - small amounts of data. They seem unsuitable for what you have in mind.
NSCoding is quite a good way to store structured data without the overhead of a database, yet it is slow in comparison to core data.
Core Data is Apples ORM, which is quite powerfull but not as easy to wrap your head around.
I answered a similar question recently, which goes into more detail regarding NSCoding with a complete example and some links for further reading.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm building an app which fetch posts from server. My question is straightforward: My UITableview has a data source. The data source can load data directly from the server when user hit reload. So why do I want a local store like core data?
One benefit is that loading from a local data store is much faster than loading from a web service. As such, a common pattern is to cache the most recently retrieved data in a local data store and display that while you're making an asynchronous request for any updates.
One example would be Facebook's apps. When you open them from a completely shutdown state they are populated with previously loaded posts, and when a refresh request completes the UI then refreshes with the new data.
The thing to remember is that with mobile devices network connectivity can be highly variable and/or non-existent. If your app requires connectivity and up to date info at all times, then maybe you don't need a local store? But it does help improve the overall user experience generally speaking.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm building a chat app. Now I know how to create a chat session, but I want to know how to preserve the data of chat history between launches.
Anyone could help me with this?
Work out a data model that can be expressed as a .plist (dictionary, array, string, number, data, date) and keep it in NSUserDefaults.
Use Core Data to mimic the data model coming in through the chat, you can then store all chat objects in core data as they are created and load them from core data on app launch.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
The question is very simple.
Should I use Core Data only to persist data, to store it locally on a device or should I use it ALWAYS just to manage my application's model even if I do not persist significant amount of data?
What do you think?
Core Data provides an infrastructure for change management and for saving objects to and retrieving them from storage. It is not, though, in and of itself a database. You can use an in-memory store in your application.
Use it Always ? : NO. Use it when you think that your require the features that the Core Data framework offers to you, like any other framework.
Short answer is no. As others said if you do not need persistent store just create runtime objects and manage them.
Even when you need persistent database, Core Data is not always the best solution. For example if you have multi-platform app, or if you plan to port your application in future I'll definitely consider use base sqlite3 with requests. This way I can use same database structure in my Android, iOS and BB application, and even my sql statements will be written only once(with their interface) and then I'll just need some platform specific implementation above them.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I want to create a searchable database in Xcode - for example, of different trees. The database would consist of the tree name, two images, price, and a short description. What is the best and most efficient way of creating such a database?
I am aware of: Core Data, SQLite3, and Parse. I am leaning towards SQLite3 but have not found a good place to learn how to implement this. Any suggestions?
Seeing as you are new to Objective-C and I doubt this will evolve into something need direct SQL I would suggest using CoreData. Although it is not technically a data base it is an object graph, it is built for exactly what you are wanting to do. Apple was even nice enough to build wrappers for everything you want to do.
CoreData to store your tree name, two images, price, and a short description.
NSFetchedResultsController for grabbing it.
UISearchBarController for letting the user search.
You would want to use Parse if you wanted to save your data to a server. If your doing everything locally I wouldn't worry about Parse. CoreData is what you want.