From 32b7c4df28e2eb3a4a8bcb71b3faae4f173f016c Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sat, 5 Mar 2011 00:14:43 +0000 Subject: Add support for auto saving expanded items. --- Source/SPGroupNode.m | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'Source/SPGroupNode.m') diff --git a/Source/SPGroupNode.m b/Source/SPGroupNode.m index 6687b29e..182a96f7 100644 --- a/Source/SPGroupNode.m +++ b/Source/SPGroupNode.m @@ -25,6 +25,9 @@ #import "SPGroupNode.h" +// Constants +static const NSString *SPGroupNodeNameKey = @"SPGroupNodeName"; + @implementation SPGroupNode @synthesize nodeName; @@ -67,6 +70,25 @@ return node; } +#pragma mark - +#pragma mark Coding protocol methods + +- (id)initWithCoder:(NSCoder *)coder +{ + if ((self = [super initWithCoder:coder])) { + [self setNodeName:[coder decodeObjectForKey:SPGroupNodeNameKey]]; + } + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder +{ + [super encodeWithCoder:coder]; + + [coder encodeObject:[self nodeName] forKey:SPGroupNodeNameKey]; +} + #pragma mark - #pragma mark Other -- cgit v1.2.3