mattt/TTTAttributedLabel — pull request #21 by zdavison (2011-10-24 10:42:17+00:00)
Title: EXC_BAD_ACCESS in drawFramesetter.

I had a few crashes in drawFramesetter that only reared their head in Release build configs (despite all build settings being identical), and seemed tied to compiler optimization.
I had a poke around and found the error was some funky array index issues with CTFrameGetLineOrigins, if passed 0 range this will traverse the array for all CGPoints, but this seemed to be causing the issue. Passing numberOfLines as a range seemed to solve this.

The thing is, that doesn't really make sense. It should be numberOfLines-1, but that throws off the framesetter completely. You probably know a lot more about CT than I do so maybe you understand this better.

----------------------------------------------------------------------------------------------------------------

Changed drawFramesetters CTFrameGetLineOrigins method to use a hard range based on numberOfLines, rather than automatic array traversal.