2 questions i've struggled for hours

1.I couldn’t let any project with my customized sprite run in a real iPad,even a very simple one,although all of them runs well in simulator.I suffer a black screen every time in my iPad2.Besides,There are no “spritepacks” folder in project made by make_project.sh,so I really want to know how and where should I put my customized spritepack in Xcode.

2.When I use xcode to build a project ,it tooks a while first time and run correctly.But when i changed something and build it again.The build will become extremely fast and my changes never appears,I almost sure it just running the version first time I builded.How can I rebuild it?
Thanks.

  1. That’s a very odd situation. Do you have a small test case that reproduces the issue?

  2. You can select “Clean” from the build menu, this will force Xcode to recompile everything. To delete the stored data, you can delete your app from your device.

It sounds like you are modifying your .lua files, and then recompiling with Xcode, and not seeing any changes. Is this what you are doing? Because the runtime isn’t designed to be used like that, if you want to use it like that you will have to modify the migrate project code in CodifyAppDelegate.m.

1.I think the situation is due to my wrong place of spritepack,because any case with sprite can reproduce it.I’ve tried to follow your advice to drag the spritepack folder with documents.spritepack(the trick you taught me:->)in it into the Xcode as a reference and copied it to the same level as “Classes”,“Frameworks” etc.But the build failed every time.so I select “move to trash” to delete spritepack folder in Xcode and simply copy it into my project folder in finder.although the spritepack doesn’t reveal in Xcode but the build successed and the sprite show correctly in simulator. Unfortunately ,when it transfer in into my iPad,it just show’s a black screen…

2.uh,yeah.I mod the lua file. got it~

. @Syeswr - If you use custom sprites in your project then you need to copy across your Dropbox.spritepack folder (using iExplorer it is in Apps → Codea → Documents - see Figure 3b in the tutorial at: http://codeatuts.blogspot.com.au/2012/08/tutorial-12-submitting-to-app-store.html) and place it in the SpritePacks folder in the project created by running the script. In our example, the destination folder is Minesweeper → SpritePacks. You will see the other standard sprite packs in the same location.

@Reefwing Nice tutorial! But all my custom sprites are import directly from iPad’s camera roll. So all of them lied in Apps->Codea->Documents, in another word, I can see all png files in the Documents directly instead of in dropbox.spritepack.In my project,the sprite is like this,for example

sprite("Documents:earth", HEIGHT/2, WIDTH/2)

So I follow Simon’s advice to export the whole Documents folder of codea and rename it into “Documents.spritepack” copy into SpritePacks…This works well in simulator,but suffer black screen in a real iPad with a strange message output message"draw is not a lua function"???

. @Syeswr - yes that should work, good thinking.

Not sure what is going on with using the iPad via Xcode. I also get the black screen of death (BSOD) when trying to run my App that way (the simulator works fine like you).

Interestingly, if I comment out the following code in the CodifyAppDelegate migrateProjectAtPath method then I can replicate the error in the simulator. I was trying to force an upgrade to the Lua files which I was editing in Xcode (In an attempt to change the App from full screen mode to console mode. If I can see the console I may be able to work out what is going on).

if ([oldVersion isEqualToString:newVersion])
    {
        return YES;
    }

@Reefwing,After a lot of experiments.(I have to make a new project for every test,because mod on lua in Xcode never reveal changes),I’ve found the solution to this,follow these steps.

1.use make_project.sh to make a new project

2.locate your project in finder and open the CodeaTemplate folder

3.move Project.codea to trash

4.rename your own project to Project.codea(P in capital) and copy it into CodeaTemplate in your project by finder

5.copy your custom sprite to SpritePacks folder below your project(as in your tutorial)

6.open Xcode to build and run~everything goes well.Not only in simulator but also your iPad.

But I still couldn’t figure out what’s wrong in previous steps~

Thanks @Syeswr - I will give rebuilding from scratch a go.