objective c - How do I load an XML document into an NSTableView? -


hi point me in right direction tutorial, guide or sample code, thanks, sami.

the answer given shreyasva close misleading.

first, parsing xml easily-managed cocoa data structure correct. performance reasons, shouldn't tying table's datasource directly xml. yan.kun's suggestion possible if have "more little" data, run performance problems. highly recommend parsing data nsarray of nsdictionary objects longer data sets.

second, core data bit overkill if don't plan persist xml document in other way or if have handful of objects. overkill long shot. it's not necessary (and not reasonable) shoehorn every data structure in app core data without reason. nsdictionary instance work fine caching parsed data consumption table view.

third, there no -tableview:cellforrowatindexpath: method. seems confusing nstableview uitableview. since specified mac tag, nstableviewdatasource protocol. cocoa bindings not "better than" or "replacement for" data source protocol. it's "alternative to". can either load parsed data nsarraycontroller (an array of dictionaries, 1 per "record", example) , bind table columns (each column bound key in dictionaries in array controller's arrangedobjects) or use (easy) table data source protocol takes literally 2 minutes of copy/paste docs , running.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -