Why does 'clean' magically fix mysterious bugs in my app?
If I ever have a problem that开发者_JAVA百科 is not showing up as a warning, but makes my app crash on runtime, sometimes I'll build->clean and often it this unkown bug disappears. This happens mostly when I import new images into the project(replacing old ones) or when I make major syntax changes with my code.
F'in 'Clean all Targets', how does it work?
Thanks
When you build for the first time, all of your code is turned into object code. That way when you make a tiny change to one file, you don't have to recompile your whole project, just that one file.
Now sometimes things go funny and stuff doesn't align properly, or dependencies aren't updated and boom crash. The build system is supposed to detect this but every project I've worked on has had this problem at one time or another.
Build clean deletes all the intermediate object code and recompile from scratch.
When you clean your project, you force your entire application to recompile itself. Maybe one of your resources was compiled into your application in a way that required you to recompile everything when changing the resources?
What sort of application are you building - do you use threads? I would make sure they aren't race conditions, because their trademark symptoms are sporadic non-reproducible errors.
精彩评论