redribben icon

teststring

redribben | PRO | 02/02/15 06:01:44 PM UTC | 0 ⭐ | 429 👁️ | Never ⏰ | []
Objective C |

0 B

|

None

|

0 👍

/

0 👎

 
NSMutableAttributedString *myString = [[NSMutableAttributedString alloc]
                                       initWithString:[NSString stringWithFormat:@"Hi, this is a test code for an example"]];
    [myString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20.0] range:NSMakeRange(20, 4)];
 
 
 
 
 
 
Option 2 (how to do this):
 
NSString *message = @"This is the the part of the code that I want to be size 20.0";
NSMutableAttributedString *myString = [[NSMutableAttributedString alloc]
                                       initWithString:[NSString stringWithFormat:@"Hi, this is a test %@ for an example", message]];
    [myString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20.0] range:?????];

Comments