Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ashwinr87

macrumors member
Original poster
Mar 9, 2011
81
0
I would like to know if there is a way to parse XML and display needed content on a UIWebView. Previously, I was using NSXMLParser to parse the XML and display it on a UITableView but the performance gets affected really badly when the XML has a huge chunk of data in it.

It would be great if someone could help me out in this.
 
Have you thought about parsing the data in the XML data and writing some simple HTML code (with loops, and arrays and what have you). Then call

Code:
NSString *html = [[NSString alloc]init];
html = @"Insert your HTML code here (from parsed XML data)"
[webView loadHTMLString:html baseURL:@"http://google.ca"];

Either that, or generate an HTML file and save it in your apps bundle and replace items with those of what you received when you parsed the XML file.

OR, are you asking about how to generate that HTML file?

Is it possible for you to only list a certain number of items in the tableview, and allow the user to "Load more" when it becomes necessary? That might assist you with performance, while still maintaining an "iOS natural feel."
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.