Skip to content

Instantly share code, notes, and snippets.

@probablycorey
Created July 26, 2010 18:55
Show Gist options
  • Select an option

  • Save probablycorey/491036 to your computer and use it in GitHub Desktop.

Select an option

Save probablycorey/491036 to your computer and use it in GitHub Desktop.
#import <UIKit/UIKit.h>
#import "lua.h"
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager changeCurrentDirectoryPath:[[NSBundle mainBundle] bundlePath]];
if (luaL_dofile(L, "data/scripts/WHATEVER-FILE-IS-NAMED.dat") != 0) {
fprintf(stderr,"Fatal error: %s\n", lua_tostring(L,-1));
}
[pool release];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment