How good is Codea at wrapping Lua to Xcode?

Hi, I’m thinking about renting a mac soon, but I was wondering if I should learn Xcode first. I’m guessing Codea will fail on some tiny tink in my code and fall over. Does anyone know if this is true?

Thanks, Prynok

My projects have build just fine but I wasnt adding anything in xcode side. I’d suggest watching videos on how to setup xcode and profiles.

@Briarfox Thanks! I’m hoping my project will be fine, as it uses some “interesting” methods to do things.

If it works in Codea, it will work in Xcode. I’m fairly sure they use the same runtime, but correct me if I’m wrong.

You’ll be surprised how easy the process is these days with the Codea export option - so at a superficial level, you dont have to go into too much detail learning the intricacies of Xcode to get up and running fairly quickly.

Indeed, I spent more time registering my development devices and setting up the profiling settings than actually compiling and running my first Codea test! After that its all pretty quick to do further build and test iterations.

Like @JakAttak says - I’d be really surprised if your doing anything that will break Xcode if it runs on the iPad. :slight_smile:

I’m having a problem with setting up xcode, im managed to get one project half working on the simulator, are there any tutorials? Ive read reefwings already, thanks.

@Luatee - what exactly are your problems? Are you getting compilation errors or having difficulty deploying a build to a device?

@andymac3d compilation errors, it was having a problem with readImage I think… Although I changed the Main.lua in Xcode and saved it and compiled it again, I took the readImage out which was the error on line 6 but its still giving me the error. I am now trying to use the export function in codea but I’m seeing differences between this and using ./ to make a template.

Edit: If you want to pm me I can show you the code I’m trying to put through and the errors I’m getting?

Here’s an error I keep getting:

2013-11-10 19:02:23.813 Destr[3882:a0b] error: [string "-- destructable..."]:6: Expected one argument

@JakAttak - There are many differences between the runtime and the runtime in the app, which I’ve been posting on the bug reporter. A lot of it has to do with physics and tweens, but your code won’t break, it’ll just not work properly.

@Luatee - Is ‘destructable’ a string used by readImage? If so, how is this created/modified prior to the readImage call? Have you tried re-exporting from Codea with the readImage commented out, rather than doing this inside Xcode? Do you get the same result? :-/

p.s. I’m sure you’ve already tried these things, just a bit of a sanity check :wink:

@andymac3d ‘destructable’ is the name of the project I exported as a test to get the hang of the exporting to Xcode process and building the project, I do have a readImage call at 6 it is:

txtre = readImage("Planet Cute:Star")

I’ve tried all the ways but I’m sure it shouldn’t matter if I do it in Codea and then export it to Xcode or to just edit it in Xcode, anyway I’m exporting a project from my iPad and saving it to the dropbox but when I get the zip off dropbox on my mac and unzip it, there are no other files in the ProjectName.codea files other than info.plist.
I’m not sure if this is because it being a different process to the manual codea template version or what but it’s just coming up as MyProject is Xcode and its pretty much blank other than the standard runtime files… It looked so easy in the tutorial but I must be missing something…

@Luatee - Is there a file that starts with “-- destructible” in your files? It must be a Lua file due to the way it’s formatted and that it has a Lua style comment. I assume so. Another thing you might try is cleaning your project (Shift - Command - K).

@Zoyt I’d say the project is looking pretty cleaned out already, I’ll give it a shot thanks.

I’m not sure this is right, I exported using codea export to Xcode and I got this:

And there’s your issue. Xcode can’t find the files. First thing is to make sure your computer is online when you run it so it can donwload the .a files. If that’s not the case, look in your project folder and correct the references of the files. If that doesn’t work, let me know.
Also, cleaning a project is basically the equivilent of clearing the cache in your browser.

Well im always connected to wifi, if that’s what you mean, ill have a look in the folder later to see if they’re there. Do they show up red because they’re referred to but not found or what? Thanks!

@Luatee CodeaViewController.h and AppDelegate.h/mm should definitely not be showing in red. It does mean they are referred to but not found. Projects exported from Codea and opened in Xcode should display those files in black. The libcodea.a/libtools.a should show in red (they will be downloaded the first time you build).

@Simeon Yeah I thought there was something wrong when I saw all the red files… Aside from that though, is the projectname.codea supposed to include more than just an ‘info.plist’ as the manual method does…

@Luatee - It seems that Codea mis-exported your project files. Yes, your .lua files should be there. In the actual file Codea exported (not the project navigator), are all the files there?