There are multiple ways to fill an NSTableView up with data through either bindings, delegates, or data sources.
What is the best way to go about filling up the tableview with data that is changed pretty frequently from an XML-RPC server? I’m targeting Mac OS X 10.5 only and there are lots of examples on how to do it, but nothing very definitive.
Any opinions?
I don’t know what the best way is. I don’t really think there’s a good way, so the ‘best way’ is really going to be ‘the least worse’ way.
Take a look at Web Services Core. It’s a Carbon API for interacting with XML-RPC and SOAP web services. I’ve only used the SOAP functionality, but the XML-RPC should work as well. It’s painful because it’s Carbon and not Cocoa; but there’s a lot of networking code you won’t have to write which should be a win.
After that, I would wrap up all of the stuff talking to WSCore into a single class and make it implement the NSTableViewDataSource protocol and just point your table view at it as the table’s data source. Every time the data from the web service changes, just call reloadData to get the table view to refresh itself.
Good luck. Web service support on OS X is painful at best, so you’re going to need it.