views:

344

answers:

1

For some reason, every time I run my Iphone App, the App works fine as long as it is upright. The second the simulator turns to the left or right (like if I manually turn it, or if it's trying to play a video), the code crashes, with either a "Bad Access" or an exception.

The crazy thing is that this stuff was JUST working, and I didn't change ANYTHING that looks like it would affect landscape mode only. Could something complicated in the background have changed to make this stop working? Is this just a symptom of some sort of memory error?

-Jenny

+1  A: 

Sure, you could be releasing something which should shouldn't release yet, or similar.

I'd put some NSLog statements in key places, start with shouldAutorotateToInterfaceOrientation and in any custom drawing functions you may have.

marcc
I'm...I'm so confused. It's working now, after h ours and hours of debugging. All I did was add a break point to some of those view controllers (like where I found Autorotate, etc.)...and it worked. I thought maybe it was because I was stepping through it, but now everything works, even on iphones that I KNOW I haven't changed code on. I'm so confused....
Jenny
Hmmm... I'd really go back to figure out the cause though. Remove the break points, clean the project, rebuild it and see what happens.
marcc
I did, and it still worked. Days later I figured out that the network I was on was speeding up (end of work day), which changed things. What turned out to be the problem is that I was releasing something that was autoreleasing. The crash only happened if I tried to release it after it had already released (because my network was running slow)
Jenny