I have a NSMutableAttributedString, I need to take substring from it.I use the following code to take substring,
startIndex and endIndex are two long variables.
This isn't how NSRange works. It is location (startIndex for you) and length. Hence the second goes from 10958 to 10958 + 12961 = 23919, which is out of bounds.
location
length