EXC_BAD_ACCESS while accessing some files
I have a bunch of .gif files that I am displaying, in turns, in a UIImageView.
On the click of specific buttons, the respective gif images are to be displayed. Some of the gifs display just fine when i click the button but for most of the cases, the App crashes without any error message. Debugging shows 'EXC_BAD_ACCESS' but when I add a breakpoint and step through 开发者_JAVA百科the program, all the gif files display correctly on clicking Continue. Anybody knows what could possibly be going wrong? Its something related to memory management i suppose but i have no clue as to where i should go looking for the problem area. ThanksThis is probably about memory management, yes. You might want to turn "Zombies" on for further investigations in that direction. However, this will only tell you if there are messages being sent to prematurely dealloced objects, not how to prevent it.
See this document to learn more about proper memory management:
Memory Management Programming Guide
These two links explain more about enabling and using NSZombie and handling EXC_BAD_ACCESS errors:
NSZombie and XCode Oh My!
SO Question about EXC_BAD_ACCESS
精彩评论