views:

37

answers:

2

I want to use coldfusion web query results to populate a UITableView in iOS. The query results come back as a string and I guess I need to convert them to NSArray or NSDictionary...

Thanks, Phill

+1  A: 

All you need to is implement the UITableViewDataSource protocol, and hook the implementation up to the table view's dataSource outlet. So you get your coldfusion results, then tell the table view to reload. Look at the documentation for the protocol to see which methods you need to implement.

Graham Lee
+1  A: 

Well, it depends on what format the results come back as. If it's XML, you'll want to parse the XML, keep the results in some sort of data object. Then use your UITableViewController's cellForRowAtIndexPath method to access the right result and display it.

Take a look at the SeismicXML sample code. I think it will go a long way to getting you where you want to go on this:

https://developer.apple.com/library/ios/#samplecode/SeismicXML/Introduction/Intro.html

Dave Klotz
thanks, what am getting is xml but its telling me that's a string and cannot be used...
phill2k12
What exactly is telling you that you can't use that string? You will need to send it through an XML parser. The standard way to do this is create a delegate for the NSXMLParser, then hand the string to the parser. The delegate has the logic to actually make sense of the XML.
Dave Klotz