html - iOS: Recieveing a crash NSInvalidArgumentException NSConcreteMutableAttributedString addAttribute:value:range:: nil value -



html - iOS: Recieveing a crash NSInvalidArgumentException NSConcreteMutableAttributedString addAttribute:value:range:: nil value -

this line error occurring on.

[self addattribute:(__bridge nsstring*)kctforegroundcolorattributename value:(__bridge id)color.cgcolor range:range];

this total method code.

-(void)settextcolor:(uicolor*)color range:(nsrange)range { if (range.location != nsnotfound) { // kctforegroundcolorattributename [self removeattribute:(__bridge nsstring*)kctforegroundcolorattributename range:range]; // work around apple leak [self addattribute:(__bridge nsstring*)kctforegroundcolorattributename value:(__bridge id)color.cgcolor range:range]; }}

i tried testing if range not found, error still occured. tips or suggestions on did wrong?

that happens because (__bridge id)color.cgcolor nil. this, without conversions

[self addattribute:nsforegroundcolorattributename value:color range:range];

html ios objective-c iphone string

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -