0

When compiler optimizations are turned on this line:

NSLog(@"start point : %@, line start x: %f, line start y: %f", NSStringFromCGPoint(staffLineStart), staffLineStart.x, staffLineStart.y);

yields

start point : {20, 88}, line start x: 20.000000, line start y: 20.000000

Edit 1: I've worked around the problem by inlining the method that populated CGPoint staffLineStart.

Bizarre.

Ian1971
  • 3,666
  • 7
  • 33
  • 61

1 Answers1

0

I have run into a weird armv6 optimization bug that I especially noticed on my apps running on iOS 4.2.1, it occurred when I did a line like this:

newView.bounds = oldView.bounds;

If you do not want to modify the original source, you can always go into the build phases and set the compiler flags to -O0 for the source files that are causing the problem. See this SO question for more information:

Trouble disabling LLVM optimizations via pragma

Community
  • 1
  • 1
BP.
  • 10,033
  • 4
  • 34
  • 53