add CPCoding support to CPIndexPath

This commit is contained in:
Klaas Pieter Annema
2011-04-13 17:31:14 +02:00
parent c317274a26
commit 97289d9070
+21
View File
@@ -145,3 +145,24 @@
}
@end
var CPIndexPathIndexesKey = @"CPIndexPathIndexes";
@implementation CPIndexPath (CPCoding)
- (id)initWithCoder:(CPCoder)theCoder
{
if (self = [self init])
{
_indexes = [theCoder decodeObjectForKey:CPIndexPathIndexesKey];
}
return self;
}
- (void)encodeWithCoder:(CPCoder)theCoder
{
[theCoder encodeObject:_indexes forKey:CPIndexPathIndexesKey];
}
@end