钛加速器奇怪的错误
我遇到了一个非常奇怪的错误。我在函数中运行以下代码:
if (throwsThisRound % 3 == 0){
debug('do it');
throwsThisRound = 0;
players[button.playerNum].throwsThisRound = 0;
changeTurn();
};
这工作得很好。但是,如果我要删除调试函数(它只是一个运行 Ti.API.debug(param)
的函数),则 if
语句中不会运行任何内容。怎么会发生这种事呢?我已经注释掉了代码,运行我的应用程序,然后取消注释代码并再次运行。我每次都可以重现这个。很奇怪。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我经常看到这样的错误。在某处添加一些行(或删除它),突然之间就不再工作了,而没有实际改变。
解决方案非常简单。转到
builds
文件夹,然后删除构建内容,但不删除文件夹本身。因此,删除这些文件夹的内容(取决于您的部署目标):
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):