Created
August 10, 2008 04:37
-
-
Save maddox/4723 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment