I wanted to know when a text is wrapped by the frame of the text view is there any delimiter with which we can identify whether the text is wrapped or not.
For instance if my text view has a width of 50 px and text is exceeding that, it wraps the text to next line.
I wanted to count the number of lines in my text view. Now "
" and "
" are not helping me.
My code is:
NSCharacterSet *aCharacterSet = [NSCharacterSet characterSetWithCharactersInString:@"
"];
NSArray *myArray = [textViewText componentsSeparatedByCharactersInSet:aCharacterSet];
NSLog(@"%d",[myArray count]);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…