diff options
Diffstat (limited to 'Source/SPTreeNode.m')
-rw-r--r-- | Source/SPTreeNode.m | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Source/SPTreeNode.m b/Source/SPTreeNode.m index 7be4f09a..3d5f2ebc 100644 --- a/Source/SPTreeNode.m +++ b/Source/SPTreeNode.m @@ -27,6 +27,9 @@ #import "SPFavoriteNode.h" #import "SPGroupNode.h" +// Constants +static const NSString *SPTreeNodeIsGroupKey = @"SPTreeNodeIsGroup"; + @implementation SPTreeNode @synthesize isGroup; @@ -248,6 +251,21 @@ } #pragma mark - +#pragma mark Coding protocol methods + +- (id)initWithCoder:(NSCoder *)coder +{ + [self setIsGroup:[[coder decodeObjectForKey:SPTreeNodeIsGroupKey] boolValue]]; + + return self; +} + +- (void)encodeWithCoder:(NSCoder *)coder +{ + [coder encodeObject:[NSNumber numberWithBool:[self isGroup]] forKey:SPTreeNodeIsGroupKey]; +} + +#pragma mark - #pragma mark Other - (NSString *)description |