Created
September 23, 2009 09:17
-
-
Save saikat/191857 to your computer and use it in GitHub Desktop.
This file contains hidden or 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/CPTextField.j> | |
var DelegateKey = @"DelegateKey"; | |
@implementation ToolbarTextField : CPTextField | |
{ } | |
- (void)initWithCoder:(CPCoder)aCoder | |
{ | |
console.log("Decoding..."); | |
self = [super initWithCoder:aCoder]; | |
if (self) { | |
console.log("Decoded delegate", [aCoder decodeObjectForKey:DelegateKey]); | |
[self setDelegate:[aCoder decodeObjectForKey:DelegateKey]]; | |
} | |
return self; | |
} | |
- (void)encodeWithCoder:(CPCoder)aCoder | |
{ | |
console.log("Encoding..."); | |
[super encodeWithCoder:aCoder]; | |
console.log("Original object", _delegate); | |
[aCoder encodeConditionalObject:_delegate forKey:DelegateKey]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment