Sunday, April 20, 2014

#1 2013-02-19 07:37:25 am

awado
Member
Registered: 2008-03-20
Posts: 34

Managing table data

Hi!

This might be a rather basic question, not necessarily related only to AppleScriptObjC: Is there any way to create a table data resource in Xcode? I'd like to manage a big table of strings, taken from a spread sheet. The data will change very often, so I need an easy way to manage such data. At the moment I have three NSArrays filled with NSStrings in the source code. But this get's messy with each row and column.

My first approach was a plist file with arrays for each key and read it into an NSDictionary. But its layout in Xcode is hard to handle if you want just a table. Core Data seems to be suitable only for complex data. Or did I miss something?

Would appreciate any hints. Thanks.

Offline

 

#2 2013-02-19 07:53:26 am

StefanK
Member
From: St. Gallen, Switzerland
Registered: 2006-10-21
Posts: 10260
Website

Re: Managing table data

Hi,

CoreData is indeed a bit overkill for this purpose.

Actually an array of dictionaries is the normal way to populate a table

Alternatively you can use an NSArrayController and a custom class instead of NSMutableDictionary with a property for each key (which I recommend). All connections can be realized with bindings


regards

Stefan

Offline

 

#3 2013-02-19 08:13:22 am

awado
Member
Registered: 2008-03-20
Posts: 34

Re: Managing table data

Thanks for your help, Stefan. So I will continue to use the dictionaries for the moment. By using TextWrangler's excellent GREP engine I can populate my source code directly with copy&paste.

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.024 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)