aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPFavoriteNode.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/SPFavoriteNode.m')
-rw-r--r--Source/SPFavoriteNode.m21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/SPFavoriteNode.m b/Source/SPFavoriteNode.m
index 55a44653..ee40f61f 100644
--- a/Source/SPFavoriteNode.m
+++ b/Source/SPFavoriteNode.m
@@ -25,6 +25,9 @@
#import "SPFavoriteNode.h"
+// Constants
+static const NSString *SPFavoriteNodeKey = @"SPFavoriteNode";
+
@implementation SPFavoriteNode
@synthesize nodeFavorite;
@@ -67,6 +70,24 @@
return node;
}
+#pragma mark -
+#pragma mark Coding protocol methods
+
+- (id)initWithCoder:(NSCoder *)coder
+{
+ if ((self = [super initWithCoder:coder])) {
+ [self setNodeFavorite:[coder decodeObjectForKey:SPFavoriteNodeKey]];
+ }
+
+ return self;
+}
+
+- (void)encodeWithCoder:(NSCoder *)coder
+{
+ [super encodeWithCoder:coder];
+
+ [coder encodeObject:[self nodeFavorite] forKey:SPFavoriteNodeKey];
+}
#pragma mark -
#pragma mark Other