ios - UIDeviceWhiteColor ctFontRef unrecognized selector sent to instance -
my app crashing , showing error
-[uidevicewhitecolor ctfontref]: unrecognized selector sent instance 0x7fbd7d892e60
i searched lot did't find solution
when set attributed text label
cell.namelbl.attributedtext = [self makeattributedstring:data.usernamestr name:data.namestr]; -(nsattributedstring*)makeattributedstring : (nsstring*)usernamestr name : (nsstring *)namestr { nsstring *tempstr = [nsstring stringwithformat:@"%@ %@",[namestr capitalizedstring],[usernamestr lowercasestring]]; nsmutableattributedstring* attrstr = [[nsmutableattributedstring alloc]initwithstring:tempstr]; [attrstr addattribute: nsforegroundcolorattributename value: [uicolor colorwithred:0.200 green:0.455 blue:0.749 alpha:1.000] range:[tempstr rangeofstring:[namestr capitalizedstring]]]; [attrstr addattribute:nsforegroundcolorattributename value:[uicolor colorwithred:0.675 green:0.718 blue:0.753 alpha:1.000] range:[tempstr rangeofstring:[usernamestr lowercasestring]]]; [attrstr addattribute:nsfontattributename value: [uifont fontwithname:@"helveticaneue" size:16] range:nsmakerange(0, tempstr.length)]; return attrstr; }
Comments
Post a Comment