Created
December 31, 2010 11:07
-
-
Save jlebrech/760936 to your computer and use it in GitHub Desktop.
This file contains 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
@implementation ProjectsView : CPView | |
{ | |
CPTableView projectsTable; | |
} | |
- (id)initWithFrame:(CPRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
// create the CPTableView | |
projectsTable = [[CPTableView alloc] initWithFrame:[self bounds]]; | |
[projectsTable setDataSource:self]; | |
[projectsTable setDelegate:self]; | |
[projectsTable setUsesAlternatingRowBackgroundColors:YES]; | |
[projectsTable setAlternatingRowBackgroundColors:[CPArray arrayWithObjects:[CPColor whiteColor],[CPColor redColor]]]; | |
var headerColor = [CPColor colorWithPatternImage:[[CPImage alloc] initWithContentsOfFile:[[CPBundle mainBundle] pathForResource:@"button-bezel-center.png"]]]; | |
[[projectsTable cornerView] setBackgroundColor:headerColor]; | |
// add the first column | |
var column = [[CPTableColumn alloc] initWithIdentifier:@"Project"]; | |
[[column headerView] setStringValue:"Project Name"]; | |
[[column headerView] setBackgroundColor:headerColor]; | |
[column setWidth:200.0]; | |
[projectsTable addTableColumn:column]; | |
[self addSubview:projectsTable]; | |
} | |
- (id)tableView:(CPTableView)tableView objectValueForTableColumn:(CPTableColumn)tableColumn row:(int)row | |
{ | |
return @"foo"; | |
} | |
// CPTableView datasource methods | |
- (int)numberOfRowsInTableView:(CPTableView)tableView | |
{ | |
return 1; | |
} | |
@end |
TypeError: Result of expression 'aSubview' [undefined] is not an object.
TypeError: Result of expression 'tableRange' [undefined] is not an object.
with index-debug.html
this is when i add it to the main view list this
projectsView = [[ProjectsView alloc] initWithFrame:[leftView bounds]];
[leftView addSubview:projectsView];
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lines 32 and 39 are giving me the following errors respectively.
TypeError: Result of expression '_2b' [undefined] is not an object.
TypeError: Result of expression '_40' [undefined] is not an object.
any ideas?