Hi all,
I have a single column table to which I want to add 2 labels : Title and subtitle. I would like to place subtitle label below the Title label. I’m fetching data from a plist and would like to assign values to the Title and subtitle labels to populate the table. Is this achievable using AppleScriptObjC and Xcode. Is there a working example of this?
It’s not clear what you want. Do you mean a window with a table, with two labels above it?
Shane,
Yes I will add a tableview to the window and each row in the table will be populated by data from plist. My prototype row will have 2 labels Title and Subtitle (Labels dragged on the row from IB). I will assign values to these labels from data in the plist.
OK, I understand. So the table column will contain a table cell view, which you can resize and to which you can add a label.
There are two ways to populate such views:
-
Bindings. In this case you bind the table view itself (not individual columns), and then bind the text views to the Table Cell View with a Model Key Path of objectValue.<the_key>.
-
You can implement -tableView:viewForTableColumn:row: in the table’s delegate, and modify each view’s labels as it’s called for. You also need a table datasource, implementing -numberOfRowsInTableView:
Your best bet is to start with the Xcode help document About Table Views in OS X Applications.