Skip to content

Instantly share code, notes, and snippets.

@saikat
Created May 12, 2009 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saikat/110665 to your computer and use it in GitHub Desktop.
Save saikat/110665 to your computer and use it in GitHub Desktop.
@implementation WidgetView : CPView
{
Widget _widget;
}
- (void)setSelected:(BOOL)isSelected
{
[self setBackgroundColor:isSelected ? [CPColor grayColor] : nil];
}
- (void)setRepresentedObject:(id)anObject
{
console.log ("Attempting to set...");
console.log (_widget);
if (!_widget)
{
console.log ("blah");
_widget = anObject;
console.log (_widget);
[self addSubview:_widget];
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment