i am using xml parser to read data from xml file. In this file it is having so many records.but i want to read data(for example in this file i am having 200 records but in the table view at first it should load 10 records after that i will keep a button to click and after clicking only it should load the next 10 records it should parse from XML file).Is there any solution for this.help me in solving this problem.
5 Answers
I think ,you will have to read XML file in one shot, So what you can do ....
You could use two array .. One for holding 200 record and other for holding 10 then 20 and so on ...
And your second array will be used by your UITableView ...
When you add more items in your second array , Just call reloadData
function of UITableView
Here is the useful SO post
What steps should be taken to convert my XML into Core Data objects?

- 1
- 1

- 31,697
- 9
- 72
- 76
-
hi dude .i am getting more than 15000 records from xml file for this reason my app is getting slowed.so i want to convert XML file into .sqllite/core data do u know any resource for converting XML file into core data/sql file – girish Apr 08 '11 at 06:45
hi dude i too faced same problem for tableview.Many solutions for your requirement 1.parse entire data and place in an array and load dynamically data into the tableview here the advantage is scrolling will be fast 2.Write a query and take the data according with the cell value.
In the table view each cell having id use that for array index.

- 3,245
- 4
- 31
- 59
-
hi dude .i am getting more than 15000 records from xml file for this reason my app is getting slowed.so i want to convert XML file into .sqllite/core data do u know any resource for converting XML file into core data/sql file – girish Apr 08 '11 at 06:44
I'm just bringing an idea, but how about using a bool and a counter? You could create one giant if-statement in the readElement-code, saying something like
if (counter < 10)
{ do nothing; }
else
{ parse; }
Actually, that 10 could be replaced by a second counter. Each time you reload the table, you make the global variable anotherCounter++
, so the if-statement would be if (counter < 10*anotherCounter) {
.
Ofcourse, this method doesn't really skip the entries. But, my guess is that if he skips all the parsing and runs through the parser in one go without processing data, it should go at least a tad faster.

- 6,292
- 8
- 55
- 90
if you have lot of data ,then i would recommend you to set no of data while requesting for xml data like 0 to 10 and parse it and display in table when u want more data you can request like form 10 to 20 again and parese and again display in tableview.
i guess it will work if your have static data ,i.e data is not changing frequently
good luck

- 1,716
- 3
- 18
- 37
You haven't said what kind of environment you are working in. Is this a standalone desktop application, or a server-side web application, or an interactive application running in a browser? The solutions are different in each case because they all have different ways of retaining data ("application state" or "partial results") between user interactions.

- 156,231
- 11
- 92
- 164
-
hi michael Kay thanks for u r .it is a server sidde web application.but i stored the file locally the folder and from there i am getting the XML list.can u please provide me solution for it – girish Apr 08 '11 at 10:49