views:

18

answers:

1

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 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. Thanks

A: 

This 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

Toastor