Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // DataSrc.m
- // summizer
- //
- // Created by Jon Maddox on 8/6/08.
- // Copyright 2008 Mustache, Inc.. All rights reserved.
- //
- #import "DataSrc.h"
- @implementation DataSrc
- - (id)initWithArray:(NSArray *)array
- {
- [super init];
- aBuffer = array;
- return self;
- }
- // The data-source protocol methods
- - (int)numberOfRowsInTableView:(NSTableView *)aTableView
- {
- return [aBuffer count];
- }
- - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
- {
- id theRecord, theValue;
- NSParameterAssert(rowIndex >= 0 && rowIndex < [aBuffer count]);
- theRecord = [aBuffer objectAtIndex:rowIndex];
- theValue = [theRecord objectForKey:[aTableColumn identifier]];
- NSLog(@"%@", [aTableColumn headerCell]);
- return theValue;
- }
- @end
Add Comment
Please, Sign In to add comment