Game Center View Controller stalls Lua draw() on iPhone

I’m working through a tutorial on creating a universal app (iPad/iPhone/iPod touch) using Codea and the runtime (http://codeatuts.blogspot.com.au/2012/10/tutorial-22-building-universal-app-in.html). This is actually quite simple with a couple of caveats. The first is that if you are going to do this then design your App for an iPhone sized screen first and try and use co-ordinates relative to the WIDTH and HEIGHT constants wherever possible.

The trickier bit is if you have Game Center integration as well. On an iPhone, the Game Center modal view controller seems to stall the draw loop. When you dismiss the Game Center view controller the screen is frozen as the the draw() function is now no longer being called. This doesn’t happen for the iPad. Even when the Game Center view controller is displayed the draw() loop continues to iterate.

This is probably because the Game Center view completely obscures the screen and so the iPhone knows that it doesn’t need to draw the hidden view (In the rendering code if the method - (void)viewWillDisappear is called it stops animating). Nevertheless I need a way to restart the draw loop once the Game Center view is dismissed.

I have found a way to do this by calling [[SharedRenderer renderer] startAnimation] when I dismiss the Game Center view controller (this method is in the BasicRendererViewController of the runtime) but I have never done any OpenGL or C++ coding, so I’m pretty much stumbling around in the dark. Does anyone see any problems with doing this?

- (void)achievementViewControllerDidFinish:(GKAchievementViewController *)viewController
{
    [[SharedRenderer renderer] dismissViewControllerAnimated:YES completion:nil];
    [[SharedRenderer renderer] startAnimation];
}