nib2cib support for CPView identifier property.

This commit is contained in:
cacaodev committed 2012-04-13 09:19:23 +02:00
1 parent 392702cc18
commit 5a99011feb
2 files changed
+9 -2

No files matched your search

+6 -2
View File
@@ -2716,7 +2716,8 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
CPViewThemeStateKey = @"CPViewThemeStateKey",
CPViewWindowKey = @"CPViewWindowKey",
CPViewNextKeyViewKey = @"CPViewNextKeyViewKey",
CPViewPreviousKeyViewKey = @"CPViewPreviousKeyViewKey";
CPViewPreviousKeyViewKey = @"CPViewPreviousKeyViewKey",
CPReuseIdentifierKey = @"CPReuseIdentifierKey";
@implementation CPView (CPCoding)
@@ -2749,7 +2750,7 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
_window = [aCoder decodeObjectForKey:CPViewWindowKey];
_subviews = [aCoder decodeObjectForKey:CPViewSubviewsKey] || [];
_superview = [aCoder decodeObjectForKey:CPViewSuperviewKey];
_identifier = [aCoder decodeObjectForKey:CPReuseIdentifierKey];
// FIXME: Should we encode/decode this?
_registeredDraggedTypes = [CPSet set];
_registeredDraggedTypesArray = [];
@@ -2890,6 +2891,9 @@ var CPViewAutoresizingMaskKey = @"CPViewAutoresizingMask",
for (var attributeName in _themeAttributes)
if (_themeAttributes.hasOwnProperty(attributeName))
CPThemeAttributeEncode(aCoder, _themeAttributes[attributeName]);
if (_identifier)
[aCoder encodeObject:_identifier forKey:CPReuseIdentifierKey];
}
@end
+3
View File
@@ -72,6 +72,9 @@ var NSViewAutoresizingMask = 0x3F,
_themeAttributes = {};
_themeState = CPThemeStateNormal;
[self _loadThemeAttributes];
if ([aCoder containsValueForKey:@"NSReuseIdentifierKey"])
_identifier = [aCoder decodeObjectForKey:@"NSReuseIdentifierKey"];
}
return self;