Commits

Anonymous committed 5fdd29a

Fixed issue where the BWToolbarItem inspector wouldn't be updated with the item identifier

  • Participants
  • Parent commits afb5dce

Comments (0)

Files changed (1)

 
 @interface NSToolbarItem (BWTIPrivate)
 - (void)_setItemIdentifier:(id)fp8;
+- (id)initWithCoder:(NSCoder *)coder;
+- (void)encodeWithCoder:(NSCoder*)coder;
 @end
 
 @implementation BWToolbarItem
 
 @synthesize identifierString;
 
+- (id)initWithCoder:(NSCoder *)coder 
+{
+    if ((self = [super initWithCoder:coder]) != nil)
+	{
+		[self setIdentifierString:[coder decodeObjectForKey:@"BWTIIdentifierString"]];
+	}
+	return self;
+}
+
+- (void)encodeWithCoder:(NSCoder*)coder
+{
+	[super encodeWithCoder:coder];
+	
+	[coder encodeObject:[self identifierString] forKey:@"BWTIIdentifierString"];
+}
+
 - (void)setIdentifierString:(NSString *)aString
 {
 	if (identifierString != aString)
 		[identifierString release];
 		identifierString = [aString copy];
 	}
-	
+
 	if (identifierString == nil || [identifierString isEqualToString:@""])
 		[self _setItemIdentifier:[NSString randomUUID]];
 	else