Skip to content

Instantly share code, notes, and snippets.

@Me1000
Created March 18, 2010 03:45
Show Gist options
  • Select an option

  • Save Me1000/336022 to your computer and use it in GitHub Desktop.

Select an option

Save Me1000/336022 to your computer and use it in GitHub Desktop.
@implementation blah : CPView
{
CPTextField textField1;
CPTextField textField2;
CPImageView image;
}
/*
do your other stuff here
*/
- (id)initWithCoder:(CPCoder)aCoder
{
self = [super initWithCoder:aCoder];
if (self)
{
textField1 = [aCoder decodeObjectWithKey:@"myTextField1"];
textField2 = [aCoder decodeObjectWithKey:@"myTextField2"];
image = [aCoder decodeObjectWithKey:@"myImage1"];
}
return self;
}
- (void)encodeWithCoder:(CPCover)aCoder
{
[aCoder encodeObject:textField1 forKey:@"myTextField1"];
[aCoder encodeObject:textField2 forKey:@"myTextField2"];
[aCoder encodeObject:image forKey:@"myImage1"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment