I want to fetch data from webservice and want to display it in to database.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
- Attempt to present UIAlertController on View Contr
In order to know how to fetch the data from web service and
NSXMLParser
please search for Parsing XML Files to know how to fetch the data through an xml and display it or use that data further. And when you will get that data you can save that data very easily to the database but it depends on you that which database you are using. Well you have two options:SQLite
Core data (Best one) refer to Apple's coreDataBooks
I would like to post my database classes that i used during developmaent:
I am agree with Vijay, After doing the steps specified by Vijay you have to use core data concepts,which includes NSManagedObjectContext and many more.NSManagedObjectContext behaves like just a scratch pad,you have to add entities and their attributes in XCDataModel file.After doing this you have to click on new file and XCode will automatically create two files with extension .h and .m of your entity name.Now you can feed data whatever you are getting from XMl parsing into entity's attributes and one most important thing don't forget to save it.And now if you want to see what you have feed to database you can use Sqlite browser.In sqlite browser you can import sqlite file which will be created when you run your application.
I think after some study you will be able to do this ,if you find any problem I can provide you a simple core data fundamental sample code.Thanks.
Soap message should be this:
Ok i am going to provide you sample code that i used in my project.. implementation of .h file
For getting data from
webservice
you have to first establish connection using asiHttp connection delegate with thewebservice
using connection delegate. And when connection establish and data comes you need to parse that data usingnsxmlparserDelegate
and then you can store that data into database.For parsing there are three delegate method:
Go through it and you get your solution.