So many Problems

im having problems with the codea runtime library. first some background:

this morning i changed my game to remove some graphics that would be used in my launch image. so i exported my codea project using iexplorer and replaced it with the (previous version) of my codea project in xcode. i pressed run and it ran my previous project even though i deleted it and emptied the trash. i tried a couple more times and still came out with the same outcome. spent over 4 hours on this. i even uninstalled xcode and installed it again. also deleted the codea runtime library and downloaded again. i removed everything related to codea from my computer and restarted.

i don’t know what’s happening and it really frustrating me. did anyone else experience this? please help, im trying to release it soon.

When you first compile and run the app in Xcode in your device the project is copied (migrated) to the Documents folder ,it works as a cache, you have to delete the project.codea from the Documents folder of the App in your device or modify the cache files to see changes… You can try to change the Objc code in Xcode to force the cache generation from the fresh project.codea…

hey @juaxix thanks for the continued support. I tried doing that by just making a duplicate project inside codea. I then transferred the duplicate project into xcode and it still gave the same results. What do you mean by deleting the cache? Where do I find it?

i just googled it and it worked by pressing cmd + shift + k in xcode and resetting settings in the ios simulator

It works if you just deleted the app from the device…or modify the function didFinishLaunchingWithOptions in XCode → Project → Classes → Supporting Files → CodifyAppDelegate.m with this code:

- (BOOL)application:(UIApplication *)
        application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [[UIApplication sharedApplication] setStatusBarHidden:YES];
    
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Create the Lua scripting state
    scriptState = [[LuaState alloc] init];
        
    self.viewController = [SharedRenderer renderer]; //[[[UIViewController alloc] init] autorelease];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    
    NSURL *url = (NSURL *)[launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];    
    if ( [url isFileURL] )
    {
        NSLog(@"Codify opened with file: %@", url);
        
        //[self openNewProject:url];
    }
    
    [OALSimpleAudio sharedInstance];
    
    NSString* path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Project.codea"];
    /*
    NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    NSString *destPath = [documentsDirectory stringByAppendingPathComponent:@"Project.codea"];
    NSError* error = nil;
    
    //If there was an error copying it means we are upgrading the project rather than just installing it,
    //So we need to ask the user what to do.
    if(![[NSFileManager defaultManager] copyItemAtPath:path toPath:destPath error:&error])
    {
        if(![self migrateProjectAtPath:path toPath:destPath])
        {
            NSLog(@"Error migrating project");
        }
    }
    
        
    self.currentProject = [[[Project alloc] initWithPath:destPath validFileTypes:[NSArray arrayWithObjects:@"lua", @"plist", nil]] autorelease];*/
    
    self.currentProject = [[[Project alloc] initWithPath:path validFileTypes:[NSArray arrayWithObjects:@"lua", @"plist", nil]] autorelease];
    
    [self showRenderView:YES animated:NO];
    [[CodifyScriptExecute sharedInstance] runProject:self.currentProject];
    
    return YES;
}

here you are forzing Codea to run the project directly from the internal dir Project.codea in stead of the copied (cached).

.@veeeralp - changing the version number in the plist of your project.codea file should also cause the runtime to copy across the lua files again.

Did you get it working?

yeah @Reefwing. i got it working. i submitted it to the app store and it said submission successful. when i refresh itunes connect, it still says waiting for upload. I read your tutorial and can’t seem to find where i could delete the binary and reupload. im using the newest version of xcode. oh btw, it’s been at waiting for upload for 56 minutes now.

.@veeeralp that doesn’t sound good. I suggest you reject the binary and try again. You can do this by:

  1. Open up iTunes Connect
  2. Click on “Manage Your Applications”
  3. Then click on the icon of your submitted App
  4. Click on the “View Details” button under the icon labelled current version
  5. In the top right under links, click on “Binary Details”
  6. Finally click Reject this Binary (top right).

.@Reefwing sorry, i totally just made a sill mistake. i skimmed through your tutorial and read that it said press the validate button and that’s all i did. i never pressed distribute. the status changed. thanks

Good to hear - now you wait! MineSweeper hasn’t made it to a reviewer yet so looks like the queue may be a bit longer than normal at the moment.