gjunkie
gjunkie

Reputation: 828

Titanium Appcelerator strange bug

I've run into a really weird bug. I have the following code running in a function:

if (throwsThisRound % 3 == 0){
    debug('do it');
    throwsThisRound = 0;
    players[button.playerNum].throwsThisRound = 0;
    changeTurn();
};

This works perfectly fine. However, if I were to remove the debug function, which is just a function which runs Ti.API.debug(param), nothing in the if statement runs. How can this happen? I have literally commented out the code, run my app, and uncommented the code and run again. I can reproduce this every time. Very strange.

Upvotes: 2

Views: 142

Answers (1)

Rene Pot
Rene Pot

Reputation: 24815

What I see very often is bugs like these. Add some line somewhere (or remove it) and all of a sudden in doesn't work anymore, without it actually changing.

The solution is very simple. Go to your builds folder, and remove the build content, but not the folder itself.

So remove the contents of these folders (depending on your deployment target):

/Titanium Workspace/Your Project Name/build/iphone/
/Titanium Workspace/Your Project Name/build/android/

Upvotes: 1

Related Questions