Hi all,
I'm working on a game with a bunch of mini games. Inside one gameview, I have the following code:
UIImage* img = [UIImage imageNamed:@"foo.png"];
someImage = CGImageRetain(img.CGImage);
[img release];
someImage is of type CGImageRef, and this has no issues the first time. After the user loses the mini game (or exits), the game and everything seems to get dealloc'd properly. Then, if they go back into the mini game, and the game gets constructed again, the line:
someImage = CGImageRetain(img.CGImage);
causes an error of some kind...almost like my UIImage object got released already. I know there's some quirks to using [UIImage imageNamed], but I can't track this down at all. Any help would be greatly appreciated :)