-5

I have following warning to use code in iOS 7.0 it will display that use sizeWithAttribute: here is the following code that I have used:

messageSize = [theMessage sizeWithFont:[UIFont systemFontOfSize:20.0]];

if any one have suggestion how to remove the above code with sizeWithAttribute: so please tell me.

Wenfang Du
  • 8,804
  • 9
  • 59
  • 90
alfa
  • 1
  • 2

2 Answers2

0

Use sizeWithAttributes: instead, which now takes an NSDictionary. Pass in the pair with key UITextAttributeFont and your font object like this:

CGSize size = [string sizeWithAttributes:
                       @{NSFontAttributeName:
                         [UIFont systemFontOfSize:20.0f]}];

Thanks

Jogendra.Com
  • 6,394
  • 2
  • 28
  • 35
0
CGSize size = [theMessage sizeWithAttributes:
                       @{NSFontAttributeName:
                         [UIFont systemFontOfSize:20.0f]}];

Hope it helps...

Iphonenew
  • 299
  • 2
  • 11