简体   繁体   中英

How to save the XML From Webservice

I am developing an application in which I am getting a XML file from web service.I am parsing xml from this and showing data in table view. Now I need to save the xml.And i want to show the data when there is no internet connection also. How can I save an XML file coming from web service??? and load it when there is no internet connection. I can save the xml if the url has name in that,like "www.xyz/asd.xml" but in webservice we dont have xml name like that,so how to save????? PLEASE HELP ME IN THIS.THANKS IN ADVANCE

NSString *link = [[NSString alloc] initWithString://webservice link

    XMLParser *parser = [[XMLParser alloc] init];
    [parser ParsewithURL:link];

Save parsed data using core data or sqlite. If you want to save xml response use NSURLConnection and write the response into a file in documents of iphone.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM