I am loading approximately 60 to 80 data from web-service.
But If you have seen “Around Me – Google – Application”
-> It has a tableView as a search result
-> In table View last cell is written as view More
-> On clicking that more data appears
I want to implement the same effect / logic to my application but don’t know how?
Would you plz help me?
Aviad Ben Dov and rkbang offer some useful advice. Adding to that:
To respond to a touch on your “View More” cell, write a
tableView:willSelectRowAtIndexPath:method (from theUITableViewDelegateprotocol) in whichever object is the delegate for yourUITableView. In this method, make a call to load more data, and returnnilso the row does not stay selected (which is more button-like behavior):In your load function, make a server call to get the data, parse it, and reload the table. It’s also polite to give a busy indicator while you’re waiting for the server reply:
In this last function, I’m assuming the method
parseIntoDataSourcewill parse the server reply and add that data to whatever your class uses to provide the data for table cells which are given by thetableView:cellForRowAtIndexPath:method (of theUITableViewDataSourceprotocol).That code also uses
HTTPHelperfrom the moriarty library.If you want to parse XML, you can use the SDK’s own
NSXMLParser. The TouchXML library is also available, and offers a little more robust support for slightly dirty data (like real-world html, which does not usually conform to XML standards). To parse JSON, you could use the json-framework, which has a very simple category-based interface.