mattt/TTTAttributedLabel — Issue #25: setText: afterInheritingLabelAttributesAndConfiguringWithBlock: missing support for text as NSAttributedString
Author: AndrewSmall
Created: 2011-11-08 13:22:25+00:00
State: open

Passing an NSAttributedString as the first parameter does have any effect. I believe there is a missing else clause in the first if statement.
The code should be:

- (void)setText:(id)text afterInheritingLabelAttributesAndConfiguringWithBlock:(NSMutableAttributedString *(^)(NSMutableAttributedString *mutableAttributedString))block {
if ([text isKindOfClass:[NSString class]]) {
self.attributedText = [[[NSAttributedString alloc] initWithString:text] autorelease];
} else {
self.attributedText = text
}

.....