iOS BAD ACCESS Error

aceiswild

macrumors newbie
Original poster
Nov 15, 2011
29
0
Canada
Hey guys i have been working on this slider puzzle for about a week now. The project builds and runs fine until i click a square to move the puzzle piece and then the app crashes with the EXC_BAD_ACCESS error! I have tried everything i can think of and checked all my releases. Its driving me nuts!! It worked ok in Xcode 4.1/iOS 4, but Xcode 4.2 seems to not want it. If somebody could please take a look to see if all the releases are there or if their may be something else, please help me out. Much appreciated. Any questions, please ask. You can email me at sgmayer@telus.net

Heres the code zipped up: http://www.mediafire.com/?1s50ml712mmw1i4

Thanks,
Steve
 

xStep

macrumors 68020
Jan 28, 2003
2,013
100
Less lost in L.A.
Use the analyzer; Menu-->Product-->Analyze

I see via that, that you are releasing an object that you do not have a retain on. Specifically the following two lines do not balance because the first does not return a retained object.

Code:
UIImage *tileImage = [UIImage imageWithCGImage:tileImageRef];
[tileImage release];
I've attached a screen capture of a line the analyzer doesn't like. When you do this, click on the blue icon to the right of your code. Click the image below to see a larger version
 

Attachments

aceiswild

macrumors newbie
Original poster
Nov 15, 2011
29
0
Canada
Slider Puzzle exc_bad_access error

Thank you a lot xStep! Ive had a headache with this since last week, and it was just that simple little error!! It's funny cause at one point i tinkered with that release but must have done something else as well!

Very much appreciated !!

Steve!
 

aceiswild

macrumors newbie
Original poster
Nov 15, 2011
29
0
Canada
Yes I did. I find it worked better then The Instruments tool because it basically pinpointed the cause. It works now without crashing! I wil work on the second leak when I get a chance but right now it's running fine!

Thanks again
Steve
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.