So what I want to do is if image1 collides with image2, I want to remove image1 from the screen (not just hide it but remove it) in a way that the application does not crash or use to much memory.
I think it’s something related with release but I’m not sure. How can I do this, please?
remove it from the superview
[image1 removeFromSuperview];EDIT:
if you have a pointer to image1, you might have just added it to the superview and did not release it yet. So, if that is the case and to avoid any leaks, just release it when removing it from superview.
[image1 removeFromSuperview];[image1 release], image1 = nil;