Added support for archiving NSTitle and NSNibBundleIdentifier from the View Controller palette for NSViewControllers.

This commit is contained in:
Justin Mecham authored and Ross Boucher committed 2009-10-27 20:49:35 -07:00
1 parent 25634a66cb
commit d263c74d5d
2 files changed
+10 -3

No files matched your search

+6 -3
View File
@@ -167,7 +167,8 @@
var CPViewControllerViewKey = @"CPViewControllerViewKey",
CPViewControllerTitleKey = @"CPViewControllerTitleKey",
CPViewControllerCibNameKey = @"CPViewControllerCibNameKey";
CPViewControllerCibNameKey = @"CPViewControllerCibNameKey",
CPViewControllerBundleKey = @"CPViewControllerBundleKey";
@implementation CPViewController (CPCoding)
@@ -185,7 +186,8 @@ var CPViewControllerViewKey = @"CPViewControllerViewKey",
_view = [aCoder decodeObjectForKey:CPViewControllerViewKey];
_title = [aCoder decodeObjectForKey:CPViewControllerTitleKey];
_cibName = [aCoder decodeObjectForKey:CPViewControllerCibNameKey];
_cibBundle = [CPBundle mainBundle];
_cibBundle = [aCoder decodeObjectForKey:CPViewControllerBundleKey] || [CPBundle mainBundle];
_cibExternalNameTable = [CPDictionary dictionaryWithObject:self forKey:CPCibOwner];
}
@@ -200,9 +202,10 @@ var CPViewControllerViewKey = @"CPViewControllerViewKey",
{
[super encodeWithCoder:aCoder];
[aCoder encodeObject:_cibName forKey:CPViewControllerCibNameKey];
[aCoder encodeObject:_view forKey:CPViewControllerViewKey];
[aCoder encodeObject:_title forKey:CPViewControllerTitleKey];
[aCoder encodeObject:_cibName forKey:CPViewControllerCibNameKey];
[aCoder encodeObject:_cibBundle forKey:CPViewControllerBundleKey];
}
@end
+4
View File
@@ -30,7 +30,11 @@
self = [super NS_initWithCoder:aCoder];
if (self)
{
_title = [aCoder decodeObjectForKey:@"NSTitle"];
_cibName = [aCoder decodeObjectForKey:@"NSNibName"];
_cibBundle = [aCoder decodeObjectForKey:@"NSNibBundleIdentifier"];
}
return self;
}