redribben

teststring

Feb 2nd, 2015
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. NSMutableAttributedString *myString = [[NSMutableAttributedString alloc]
  3.                                        initWithString:[NSString stringWithFormat:@"Hi, this is a test code for an example"]];
  4.     [myString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20.0] range:NSMakeRange(20, 4)];
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. Option 2 (how to do this):
  12.  
  13. NSString *message = @"This is the the part of the code that I want to be size 20.0";
  14. NSMutableAttributedString *myString = [[NSMutableAttributedString alloc]
  15.                                        initWithString:[NSString stringWithFormat:@"Hi, this is a test %@ for an example", message]];
  16.     [myString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:20.0] range:?????];
Advertisement
Add Comment
Please, Sign In to add comment