I have started a tutorial on integrating Game Center into a Codea App (http://codeatuts.blogspot.com.au/2012/09/tutorial-19-integrating-game-centre.html). This is all fairly straight forward until I need to save a score or achievement. The difficulty is that all the Game Center code needs to be done in Objective C so I need a way for my Codea lua code to exchange information with or trigger a method in say the CodifyAppDelegate in the runtime (although just about anywhere in the Objective C code would do since I can always get back to the App Delegate).
I can bodge something up using NSUserDefaults or some other pList but ideally I would like to create some sort of call back or delegate in Objective C which gets triggered from within the lua project code.
In addition, I would like a button in my Lua code to be able to trigger a method in Objective C (so for example the user can bring up the Game Center view to check high scores in their App). I suspect solving the first problem will also solve this one. I can probably just overlay a button on the Codea view in Xcode but this doesn’t seem like an elegant solution. I also seem to remember that mixing UIKit and OpenGL can lead to problems, but I could be wrong.
So before I tear off down the wrong road, does anyone have any suggestions on how this might be done?