Skip to content

error when using uilabel with DAAttributedStringFormatter #2

@crivera

Description

@crivera

hi

i am creating a formatter in my uitableview:cellForRowAtIndexPath

DAAttributedStringFormatter* formatter = [[DAAttributedStringFormatter alloc] init];
formatter.defaultFontFamily = @"Gotham Rounded";
formatter.defaultPointSize = 17.0;
formatter.defaultWeight = 1;
formatter.defaultColor = [UIColor whiteColor];
formatter.defaultBackgroundColor = [UIColor clearColor];
NSAttributedString *s = [formatter formatString:@"test"];
cell.myLabel.attributedText = s;

myLabel is a UILabel and it doesn't break right away but i get this error i guess on render (btw if i change the label to a DAAttributedLabel it works fine... but why doesnt it work with a regular uilabel?)

terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[**NSCFType set]: unrecognized selector sent to instance 0x79833e80'
* First throw call stack:
(
0 CoreFoundation 0x048a9946 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x04211a97 objc_exception_throw + 44
2 CoreFoundation 0x048b15c5 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
3 CoreFoundation 0x047fa3e7 __forwarding
+ 1047
4 CoreFoundation 0x047f9fae _CF_forwarding_prep_0 + 14
5 UIFoundation 0x08faceae -[NSLayoutManager(NSPrivate) _drawBackgroundForGlyphRange:atPoint:] + 2335
6 UIFoundation 0x08fe5149 -[NSLayoutManager drawBackgroundForGlyphRange:atPoint:] + 70
7 UIFoundation 0x0900052e -[NSStringDrawingTextStorage drawTextContainer:withRect:graphicsContext:baselineMode:scrollable:padding:] + 1187
8 UIFoundation 0x08ff8078 __NSStringDrawingEngine + 9996
9 UIFoundation 0x08ffd10b -[NSAttributedString(NSExtendedStringDrawing) drawWithRect:options:context:] + 622
10 UIKit 0x02cb3891 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 6626
11 UIKit 0x02cb1574 -[UILabel drawTextInRect:] + 581
12 UIKit 0x02cb3996 -[UILabel drawRect:] + 98
13 UIKit 0x02b2895c -[UIView(CALayerDelegate) drawLayer:inContext:] + 519
14 QuartzCore 0x0283ad61 -[CALayer drawInContext:] + 118

any help is appriciated

Thanks
Chris

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions