I have taken a several month break from Codea, but have finally gotten around to updating Acorn Mayhem, and want to upgrade Acorn Mayhem to the codea 2.1 (or now 2.3) runtime, and fixing support for the xcode addons.
I have 2 questions, where do I get the updated runtime, and how do I update my Xcode addons to match? I need to fix @Zoyt 's Sharing addon and In-App purchase addon.
Thanks, ~Patrick
EDIT: I tried following these instructions to update the runtime, and then these to update the addons, but when I started replacing CodeavViewController with StandaloneCodeaViewController I get numerous errors and am unsure if everywhere that says codeaviewcontroller needs replacing or just some of them. I needed to restore with time machine to get the game back to a working state. How do I update them properly?
Progress report: I modified appdelegate.h, appdelegate.mm, iadsaddon.h, iadsadon.m, codeaaddon.h, codeaaddon.m, and standalonecodeaviewcontroller.h to match their equvalents in a freshly exported project, but need help with iapaddon.h/.m. in the meantime I tried to comment them out to test the rest of the code, but get errors in the freshly imported gamecenteraddon.m, saying “Implicit declaration of function ‘luaL_setfuncs’ is invalid in C99”. I was surprised since this was copied straight from an exported project. what could be going wrong? What should I do?
@pleiser all the header files in the <project>/Lua folder will need to be updated to the ones exported from a new project.
My recommendation would be to do this the other way around: export a working version of your game from Codea 2.3, then add and fix the third-party addons.
@Simeon, thanks, but after I copied over the header files from the /lua folder, I get several "Apple Mach-O Linker Error"s see this screenshot. what should I do?
Also, I can’t export a version of my game because pretty much half of the game was written after exporting to xcode.
EDIT: I realised the script (under build phases> run script) was set to download version 2.0 of the runtime, I replaced it with the script from the freshly exported program. Now it downloaded the proper version of libtools and libcodea, and it builds sucessfully, but it crashes before it finishes running. according to the exception breakpoint it is failing when execution hits the line (in AppDelegate.mm)
[self.window makeKeyAndVisible];
, it gives the error message:"
AcornMayhem[20865:7787230] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x1824ca59c 0x1930380e4 0x1823b3290 0x1000b390c 0x1000d3afc 0x1000d10cc 0x100119580 0x186c79184 0x186c78e94 0x10011a040 0x10011b794 0x10011bffc 0x10014a2b4 0x10014a324 0x100156e80 0x186c79184 0x186c78e94 0x186c7f55c 0x186c7ccdc 0x186cedd24 0x1000b135c 0x186cea6f0 0x186f01688 0x186f03e08 0x186f024a0 0x18a70562c 0x182482a28 0x182481b30 0x182480154 0x1823ad0a4 0x186ce3aac 0x186cdeaa4 0x1000ad6d8 0x1936a6a08)
libc++abi.dylib: terminating with uncaught exception of type NSException
@pleiser but you could re-export your game and then copy the old <GameName.codea> folder into the newly exported project? That would ensure your Lua code is all up-to-date.
I don’t think I will do that right now, a lot of the changes were done in xcode, I want to keep it like this for now. any suggestions on how to fix this crash?
@Zoyt @ pleiser I have a version of the addon that I modified to the point that it doesn’t spit out an error in Xcode. I’ll share it, just not sure how I should share it since its in a folder with the rest of the easy iap classes.
EDIT: Even though there are no errors, I still doubt it will work. The reason I can’t test it is because Indont have a dev account.