Guest User

Untitled

a guest
Feb 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. //
  2. // DataSrc.m
  3. // summizer
  4. //
  5. // Created by Jon Maddox on 8/6/08.
  6. // Copyright 2008 Mustache, Inc.. All rights reserved.
  7. //
  8.  
  9. #import "DataSrc.h"
  10.  
  11.  
  12. @implementation DataSrc
  13.  
  14. - (id)initWithArray:(NSArray *)array
  15. {
  16. [super init];
  17.  
  18. aBuffer = array;
  19. return self;
  20. }
  21.  
  22.  
  23. // The data-source protocol methods
  24. - (int)numberOfRowsInTableView:(NSTableView *)aTableView
  25. {
  26. return [aBuffer count];
  27. }
  28.  
  29. - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
  30. {
  31. id theRecord, theValue;
  32.  
  33. NSParameterAssert(rowIndex >= 0 && rowIndex < [aBuffer count]);
  34. theRecord = [aBuffer objectAtIndex:rowIndex];
  35. theValue = [theRecord objectForKey:[aTableColumn identifier]];
  36.  
  37. NSLog(@"%@", [aTableColumn headerCell]);
  38. return theValue;
  39. }
  40.  
  41.  
  42.  
  43. @end
Add Comment
Please, Sign In to add comment