I am currently experiencing some strange behavior when mixing cocos2d with UIKit. I've been tracking the zombies and it's always an overrelease that triggers the crashes. Now I know this is vague so I'll sketch a scenario where this happens in detail when using a native uikit object.
I have this piece of code :
// I create a new UIActivityViewController and present it on my appDelegate viewController
self.activityViewController = [[UIActivityViewController alloc] initWithActivityItems:[NSArray arrayWithObjects:tempImage, nil]
applicationActivities:nil];
[[appDelegate viewController] presentViewController:self.activityViewController
animated:YES
completion:nil];
The first time I call this it works, the viewController comes on, and I can dismiss. The second time I try to create a new ActivityController it crashes.
Now this also appears to be the case when removing a UIViewController subclass, and then starting CCDirector that contains UIKit elements. The strange thing is that I get the overrelease on properties of the first UIViewController, which I don't when not switching to a cocos2D scene.
I am running cocos2D in a project using ARC, not using ARC is not an option.
If anyone has had such problems and can point me into the right direction please do.
Thanks !