Created
June 20, 2011 22:56
-
-
Save bdittmer/1036804 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
@import <AppKit/AppKit.j> | |
@implementation WVNavigationViewController : CPViewController { | |
@outlet CPTableView navTableView; | |
@outlet CPView navItemView; | |
} | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
[[[navTableView tableColumns] objectAtIndex:0] setDataView:navItemView]; | |
} | |
- (int)numberOfRowsInTableView:(CPTableView)aTableView { | |
return 2; | |
} | |
- (id)tableView:(CPTableView)aTableView objectValueForTableColumn:(int)aColumn row:(int)aRow { | |
CPLog("tableView:objectValueForTableColumn"); | |
if(aRow == 0) return { "name":"Welcome!" }; else return { "name":"User Insight" }; | |
} | |
@end | |
@implementation WVNavItem : CPView { | |
@outlet CPImageView imageView; | |
@outlet CPTextField textField; | |
} | |
- (void)setObjectValue:(Object)object { | |
CPLog("setObjectValue: " + object.name); | |
[textField setStringValue:object.name]; | |
} | |
- (id)initWithCoder(CPCoder)aCoder { | |
self = [super initWithCoder:aCoder]; | |
imageView = [aCoder decodeObjectForKey:"imageView"]; | |
textField = [aCoder decodeObjectForKey:"textField"]; | |
return self; | |
} | |
- (void)encodeWithCoder:aCoder { | |
[super encodeWithCoder:aCoder]; | |
[aCoder encodeObject:imageView forKey:"imageView"]; | |
[aCoder encodeObject:textField forKey:"textField"]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment