NSStringDrawingTextStorage textContainerForAttributedString:containerSize:lineFragmentPadding

548 Views Asked by At

Instance method of String to get height of text sizeWithFont:constrainedToSize:lineBreakMode: is deprecated for ios7. So I used boundingRectWithSize:options:context:. But it shows this issue:

-[NSStringDrawingTextStorage textContainerForAttributedString:containerSize:lineFragmentPadding:]: message sent to deallocated instance

My text is like this :

\n Hello Test String \n\n Again Test String \n Test String

I dont know the issue but I think may be the \n characters or other HTML characters are the reason for this. I tried this LINK. But not any help.

Please guide what to do...!!!

Thanks in advance.

0

There are 0 best solutions below