Sometimes when I run my project, the building will take forever (like 10 min) and sometimes it'll be a couple seconds. This usually happens when I include third party code too. It usually shows "Checking source control status". Has anybody else开发者_如何学编程 experienced this?
I think XCode occasionally caches files that it shouldn't, and gets confused. You can observe this effect if you ever change an image in your project but notice that the older one still shows up.
To fix the hanging problem, you can do what's called "Cleaning" your build folder, which basically deletes all the old files that have been built. Go up to Product -> Clean (or shift+cmd+k), and let it do its thing. Build again, and you're set.
Just canceling and rebuilding your target, in my experience, fixes the issue for the current build but not forever. This method seems to work a little bit better. Regardless of how this issue comes about, I think it's just a bit of a bug with XCode 4.
Hope this helps.
精彩评论