November 2013
Beginner
325 pages
9h 47m
English
Now that you have TahDoodle’s user interface created, configured, and connected, the next step is to get the data source-table view relationship working. You cannot do this in Interface Builder, so it is time to go back to writing code.
Reopen BNRDocument.h and declare that BNRDocument conforms to the NSTableViewDataSource protocol:
#import <Cocoa/Cocoa.h>
@interface BNRDocument : NSDocument
<NSTableViewDataSource>
...
@end
In BNRDocument.m, implement the two required NSTableViewDataSource methods:
#pragma mark Data Source Methods
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tv
{
// This table view displays the tasks array,
// so the number of entries in the table view will be the same ...Read now
Unlock full access