-
Book Overview & Buying
-
Table Of Contents
Mastering macOS Programming
By :
Firstly, we need to start a new project. All we need here is the standard macOS template with which we started the project in Chapter 6, Cocoa Frameworks: The Backbone of Your App, so create that first.
Before we can get going on the code for the table view itself, we need to add a couple of properties to the View Controller that will manage the window in which that table view is built.
Add the following lines of code to the ViewController class:
class ViewController: NSViewController
{
var tableView: NSTableView!
var infoLabel:NSTextField!
} We will create both of these UI elements without the aid of Interface Builder. This means we have three tasks to perform:
NSTableView.NSTextField info label.We'll create a method for each of those steps, but since they will only ever be used once, we will declare them within the scope of an umbrella function, buildUI. While it would be...