0

I have one long string :

NSString* string=@"I'm very long, you can't handle me in one small label, you should separate me and use 2 labels";

So i have two labels. I want to cut the head of the string to fit first label : [string giveMeSomeTextSuitableForFirstLabel] - as example; result should be: @"I'm very long" and the rest of the string should be: @", you can't handle me in one small label, you should separate me and use 2 labels";

I can't use 1 label instead of two, because there is one image on the corner that covers my first line.

tshepang
  • 12,111
  • 21
  • 91
  • 136
mikezs
  • 410
  • 1
  • 8
  • 16

1 Answers1

2

This answer might be what you're looking for:

labelOne.lineBreakMode = NSLineBreakByWordWrapping;

Then calculate the size of the text chunk.

Community
  • 1
  • 1
runmad
  • 14,846
  • 9
  • 99
  • 140