From 97289d9070eb8cc078fda5e6f2adb742e4e29cfd Mon Sep 17 00:00:00 2001 From: Klaas Pieter Annema Date: Wed, 13 Apr 2011 12:08:18 +0200 Subject: [PATCH] add CPCoding support to CPIndexPath --- Foundation/CPIndexPath.j | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Foundation/CPIndexPath.j b/Foundation/CPIndexPath.j index d1413a2c0..a7ee64137 100644 --- a/Foundation/CPIndexPath.j +++ b/Foundation/CPIndexPath.j @@ -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