-
Notifications
You must be signed in to change notification settings - Fork 315
/
StatMonitorTableController.m
53 lines (41 loc) · 1.39 KB
/
StatMonitorTableController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// statMonitorArrayController.m
// MongoHub
//
// Created by Syd on 10-12-23.
// Copyright 2010 ThePeppersStudio.COM. All rights reserved.
//
#import "StatMonitorTableController.h"
#import <BWToolkitFramework/BWToolkitFramework.h>
@implementation StatMonitorTableController
@synthesize nsMutaryDataObj;
@synthesize nsTableView;
- (void)dealloc {
[nsMutaryDataObj release];
[nsTableView release];
[super dealloc];
}
- (void)addObject:(NSDictionary *)item {
if (!nsMutaryDataObj)
nsMutaryDataObj = [[NSMutableArray alloc] initWithObjects:item, nil];
else
[nsMutaryDataObj addObject:item];
[nsTableView reloadData];
NSInteger numberOfRows = [nsTableView numberOfRows];
if (numberOfRows > 0)
[nsTableView scrollRowToVisible:numberOfRows - 1];
}
- (int)numberOfRowsInTableView:(NSTableView *)pTableViewObj {
return [self.nsMutaryDataObj count];
} // end numberOfRowsInTableView
- (id) tableView:(NSTableView *)pTableViewObj
objectValueForTableColumn:(NSTableColumn *)pTableColumn
row:(int)pRowIndex {
NSDictionary * zDataObject = [self.nsMutaryDataObj objectAtIndex:pRowIndex];
if (! zDataObject) {
NSLog(@"tableView: objectAtIndex:%d = NULL",pRowIndex);
return NULL;
} // end if
return [zDataObject objectForKey:[pTableColumn identifier]];
} // end tableView:objectValueForTableColumn:row:
@end