I'm sure mutable means it can be changed, so why is this happening?
attrString = [[NSMutableAttributedString alloc] initWithString:@"Tip 1: Aisle Management The most obvious step β although one that still has not been taken by a disconcerting number of organisations β is to configure cabinets in hot and cold aisles. If you havenβt got your racks into cold and hot aisle configurations, we can advise ways in which you can achieve improved airflow performance."];
[attrString setFont:[UIFont systemFontOfSize:20] range:NSMakeRange(0, 23)];
[attrString setFont:[UIFont systemFontOfSize:15] range:NSMakeRange(24, 325)];
[attrString setTextColor:[UIColor blackColor] range:NSMakeRange(0,184)];
[attrString setTextColor:[UIColor blueColor] range:NSMakeRange(185,325)];
break;
Both my catextlayer and my nsmutableattributedsring are defined in my header file. I make changes to my line above in the switch and then call this code to update catextlayer, the line is shown in:
TextLayer = [CATextLayer layer];
TextLayer.bounds = CGRectMake(0.0f, 0.0f, 245.0f, 290.0f);
TextLayer.string = attrString;
TextLayer.position = CGPointMake(162.0, 250.0f);
TextLayer.wrapped = YES;
[self.view.layer addSublayer:TextLayer];
It fires when it tries to install a font, but I canβt understand why?
- [NSConcreteMutableAttributedString setFont: range:]: unrecognized selector sent to instance 0xd384420 * Application terminated due to an uncaught exception "NSInvalidArgumentException", reason: '- [NSConcreteMutableAttributedString setFont: range:]: unrecognized instance38, 0x3838d
Why is this happening?