i have server and there i have store the some data for eg;username is abc and password is 123
and same password and come in json i have to store same data in loca database by using sqlite in iphone
please help me
Yes, you can store in sqllite3 database, Follow the below link..
http://www.techotopia.com/index.php/An_Example_SQLite_based_iPhone_Application
Depending on how you talk to your database, something like RestKit might be a useful, open source starting point.
You can use SBJSON Parser and then simply call [YourResponseString JSONValue]. And you can return this into an NSDictionary.
Hope this helps.
Related
I want to fetch data from JSON and store it automatically to sqlite whatever updated on server automatically updates to database whenever program runs.
Can anyone help me out in it. And if my question is not sufficient to answer please ask anything required.
Thanks in advance.
I would look into the RestKit framework. It takes care of the low-level API calls, object mapping, SQLite persistence, etc. It's well documented and maintained.
You can start here http://www.raywenderlich.com/5492/working-with-json-in-ios-5
After reading this, you can user this Class, https://github.com/AFNetworking/AFNetworking. It's easy and usefull!
Download JSON data with AFNetworking and decode with JSONKit, then you can save to SQLite with this wrapper FMDB.
If your supporting iOS 5+ then JSON is added for you by default and can use it using the method given here and after getting the dictionary of objects , you can follow the normal procedure of adding them to sqlite or use core data as said by #Paras Joshi.
i'm developing an iPhone app for the first time. I know that username and password commonly stored in KeyChain. How about data like FirstName, ProfilePictureUrl, I got the data from a rest api. Since those data (firstname...) barely changed, i'm thinking to store it somewhere locally. SHould I use KeyChain as well? or SQLLite? XML?
thanks
you can use sqlite to store them in a local database. or NSUserDefault if you are not expecting massive data.
the simplest solution would be to store them in a .plist file
an example tutorial can be found here: http://ipgames.wordpress.com/tutorials/writeread-data-to-plist-file/
I want to store JSON parse data(companyName and companyID) in Iphone locally. I also can add or delete JSON parse data(companyName and companyID) in store data.
It depends on the amount of data you wanna store. If it's gonna be less then 1000 I would recommend you to store it as plist, otherwise you can use core data or SQLite.
I'm sure this article will help you out... it's for Flickr but shows how to play with JSON :)
http://iosdevelopertips.com/networking/iphone-json-flickr-tutorial-part-1.html
you can try to use NSUserDefaults if it´s just about a single company, not a collection
https://developer.apple.com/documentation/foundation/userdefaults
if not SQLite would be the best solution
I am working on a new project where i want to setup the database and access the values whenever i want.So i don't know how to start this.what library should be used for this.Can any one help me...
Thanks,
Anish
Core Data can be a good way to get some abstraction: http://www.raywenderlich.com/934/core-data-tutorial-getting-started
Or, go with SQLite: http://dblog.com.au/iphone-development-tutorials/iphone-sdk-tutorial-reading-data-from-a-sqlite-database/
Highly recommend to use Core Data. You can use SQLIte as the store for your Core Data application. Please refer the apple docs here.
You can use SQLite Manager an Add On of firefox. To See the SQLite Store created by Core Data.
My question deals delivering information to iPhone devices via an online DB. (Essentially, I want to do something like the NYTimes App, which provides the latest news for each device containing the app). I know I need to use a SQL lite database to accomplish this. What is the best way to approach this problem? I am a newbie at this stuff, so I'm not sure exactly where to get started? Do I need to create an online DB, or can I update outstanding apps from a local SQL database?
Thanks in advance!
Vineet
For connecting to remote databases for getting data you will have to send request from iphone either in XML or JSON format.
If you are using XML, then use NSXMLParser for parsing the XML file sent as response from the remote application. Better option would be to go for JSON.
You need to create a web application which should return a data to iPhone over http protocol.
I think I've done something similar a while ago.
I created a simple PHP API which returns the posts from a blog in JSON form. Then in the iPhone app I make an API request, parse the resulting JSON string and setup a UITableView with the stuff I retrieved from the database. In this way you don't query the database directly, it's the PHP script that does it.
You could also use XML instead of JSON, of course. If you end up using JSON, you can use this library to parse it in your app.