Why does 'clean' magically fix mysterious bugs in my app?
Asked Answered
G

2

6

If I ever have a problem that 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

Glaciology answered 26/7, 2010 at 22:29 Comment(0)
H
7

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.

Highpowered answered 26/7, 2010 at 22:37 Comment(0)
R
2

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.

Roam answered 26/7, 2010 at 22:36 Comment(1)
'Inadvertently'? I thought that was one of the primary purposes of clean.Dacca

© 2022 - 2024 — McMap. All rights reserved.