diff --git a/Source/GSXib5KeyedUnarchiver.m b/Source/GSXib5KeyedUnarchiver.m index 11b57d990a..858e96ac56 100644 --- a/Source/GSXib5KeyedUnarchiver.m +++ b/Source/GSXib5KeyedUnarchiver.m @@ -3169,36 +3169,40 @@ - (void) addOrderedObject: (GSXibElement*)element } } -- (id) decodeObjectForXib: (GSXibElement*)element - forClassName: (NSString*)classname - withID: (NSString*)objID +- (void) addToolTip: (GSXibElement *)element forObject: (id)object { - // Try decoding the object using super first... - id object = [super decodeObjectForXib: element forClassName: classname withID: objID]; - - [self addOrderedObject: element]; - + NSString *toolTipString = [element attributeForKey: @"toolTip"]; + // Process tooltips... - if ([element attributeForKey: @"toolTip"]) + if (toolTipString == nil) { - if ([object respondsToSelector: @selector(setToolTip:)]) - [object setToolTip: [element attributeForKey: @"toolTip"]]; - else if ([object respondsToSelector: @selector(setHeaderToolTip:)]) - [object setHeaderToolTip: [element attributeForKey: @"toolTip"]]; + GSXibElement *toolTipElement = [element elementForKey: @"toolTip"]; + + toolTipString = [toolTipElement value]; } - else if ([element elementForKey: @"toolTip"]) + + if (toolTipString != nil) { - GSXibElement *toolTipElement = [element elementForKey: @"toolTip"]; - NSString *v = [toolTipElement value]; if ([object respondsToSelector: @selector(setToolTip:)]) { - [object setToolTip: v]; + [object setToolTip: toolTipString]; } else if ([object respondsToSelector: @selector(setHeaderToolTip:)]) { - [object setHeaderToolTip: v]; + [object setHeaderToolTip: toolTipString]; } } +} + +- (id) decodeObjectForXib: (GSXibElement*)element + forClassName: (NSString*)classname + withID: (NSString*)objID +{ + // Try decoding the object using super first... + id object = [super decodeObjectForXib: element forClassName: classname withID: objID]; + + [self addOrderedObject: element]; + [self addToolTip: element forObject: object]; // Process IB runtime attributes for element... // Ensure we don't process the placeholders...