Whenever we want to display a table of rows and columns in a Mac OS X App, we can use a GUI object called a table view, or in programming terms an NSTableView
object. We can have any number of rows, any number of columns, and even multiple NSTableView
objects in our GUI.
Since we have an
NSTableView
object for both our number categories and our number key-value pairs, we need to think of a way to store the information inside our program code. Since NSTableViews
lend themselves naturally to NSArrays
, we may choose to represent the rows of each table with the row of an array. In turn, the array rows can contain an NSDictionary
object, where the dictionary key corresponds to a table column identifier. We end up with something like the following screenshot:
This "array of dictionaries" seems like a good choice for storing the information in our program.