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 9 years ago.
Improve this question
I need to create an app that does some communication with a server.
My app must post some requests to server, to aspx webservices. Then get back some JSON/XML response.
The question is do I need Core Data?
IMHO it would be enough to have a UIViewController with text field items and to perform submit to provided server webservice URL. The result could be processed with some Json/XML parser library and showed in UITableViewController.
So, I not sure do I have to use Core Data? And why? :)
No you don't have to use core data in order to communicate with a web service/JSON service - you can do exactly as you describe. The only need for core data is if you want information you download from the web service (or created by the user during the session) to remain available between hard shutdowns of the app. (or be available when you have no internet connection)
I'm not sure you understand what core data is.
Core data is a way of communicating to localised sqlite databases without using sql code (as it were). It effectively creates objects that you can use to manipulate and use databases.
To download and post data to and from the internet you don't need to use it at all, unless you want to store the data when you would use it to download the data and store it in a localised database for use later.
A better way to do this though would be to just download the XML/json file directly to the working directory of the app and use it from there (if you want offline/cached use from it).
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm new to Swift and I'm building on a simple app that relies on login/sign up functions for each user. When I wanted to learn about databases in Swift, I came across Core Data and from what I understood it's like cookies/cache that stores data in the user's phone. If that's so, what's the best way to connect the app to a regular database like SQL?
Core Data is an ORM (object-relational mapping) system. Overly simplyfied you build your data model entities and and relationships between them and Core Data cares about the rest. Under the hood it uses an SQLite database by default, but it also can handle other types of storage (e.g. binary or XML).
To answer your question, for Login/Signup purposes you should look into storing user data such as auth tokens etc. in the Keychain.
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 7 years ago.
Improve this question
I'd like to get the data of a website. I'd like to display the table in an app. Do you have an idea how I could do it? Thanks for your answers!
Usually, you'd want the maintainer of the data you need to supply some API for machine-to-machine communication (a REST JSON web service, for example).
Since you are asking how to display the table in an app:
the easiest way would be to just point an UIWebView that way and go from there.
a more native look might be acomplished by parsing the data. As you included several 'parsing' tags, I guess this is what you'd prefer.
The problem with HTML scraping web pages (what you probably hope to do) is that the data you are looking for and foremost it's structure is prune to changes. If some unexpected changes can easily break your parser.
Thus, if you go for doing that (which might be prohibited by your school or other publisher, especially in germany), try to parse the data on your server and offer an web service for your app yourself. This way, you can react to changes of the structure faster and do not break the app for your users.
Seriously consider asking the school for an API.
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 5 years ago.
Improve this question
I want to make an app like Instagram but the problem is where to store all text and images data, I have used Instagram when there is no connectivity available then app will show the last feeds even when app is freshly openend (not from background). It uses core data or sqlite.
I came across a scaling presentation from instagram a little while back where they talk how they started, using what and then how they approached the challenges.
See the link: http://www.scribd.com/doc/89025069/Mike-Krieger-Instagram-at-the-Airbnb-tech-talk-on-Scaling-Instagram
Hope this helps.
It's not known what Instagram uses. Use whatever you feel most comfortable with. Anything is possible with any storage technology, although some might fit better than others. Also, regarding your question on "core data or sqlite", you can use Core Data with an SQLite database as a backend (way easier than accessing raw SQL). You can also use other backends with Core Data: binary and XML.
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 6 years ago.
Improve this question
I'm working on an iphone app and i would like to seek advices on what's the best architecture for it.
Basically, the app implements facebook connect for users to login. Users will be able to select their friends whom they can message/send photos to (think of whatsapp). I will have a server which i intend to use to store their sent messages and photos. Whats's the best way to separate the components? And also, should the logic that deals with sending data to my server and reading from it know anything about the facebook connect componenet?
Does anyone has any ideas on whats the best architecture for such an app?
Compartmentalizing data access is a widely accepted practice and in your case, data access is:
Connecting to FB
Connecting to your database server
Ideally your domain logic shouldn't know where it is getting data from (web service, database, FB, G+, etc). All it should know is that it is getting data, and what it should do with that data.
Some common patterns that address abstracting your data access layer from your domain layer are:
Repository
DataMapper
The above links are to Martin Fowler's blog, but some searching around google or stackoverflow should yield additional clarity:
Data Access Layer Design Patters
Microsoft Article, but relevant to any modern OOP language (even mentions ruby).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I have built an iPhone app that needs to pull data from a server. First I need to figure out what kind of server I will need. I'm a bit familiar with MySQL but was wondering if anyone had better suggestions on a backend. My app will have two tables that need to be populated by data residing on a server. Also, a user can submit data to this database which in turns populates the previously mentioned tables.
If you have any tips or tutorials, code snippets, etc. it would be really appreciated!
*Edit: I should mention this IS a remote database
Well if it's a remote server your thinking about then you should be looking into implementing some kind of service architecture like Web Services over SOAP or REST.
If the data stays on the iPhone than by all means use SQLite as it's fast and lightweight.
I would recommend starting with SQLite and local data first. Then when you have your main program logic, flow and UI complete, replacing the SQLite with Web Service calls.
Your database sounds really simple with just two tables. Perhaps you don't even need a SQL database. Perhaps a Berkeley DB would be sufficient. It has atomic commit, transactions, rollback etc. However you store data as key-value pairs.
However I am not sure if you can use it as a server. You could consider accessing the data through something like remote objects. This is done very easily in Cocoa. You could build a Berkeley DB on your sever that hosts the data as distributed objects that your iPhone app connects to.