Reputation: 2983
Every once in a while, usually after I've done some trial and error on my code, Xcode throws random errors at me even though I've removed the previous incorrect code snippets, and even though I've restored my files to a stage where it last worked perfectly. In other words, there are no errors for sure, yet my app crashes and Xcode generates errors. I shall also add that when my iPhone isn't connected to my computer, the app runs just fine.
After having removed everything that did cause errors in the past, Xcode - as described above - instead points to random stuff as being incorrect such as closing brackets, viewDidLoad, as if saying: "Hey, I know there was an error before, can't find it now though but I know it's there somewhere so lets crash and point at something completely random such as a closing bracket".
I assume the old project files are being cached (or similar) somewhere but I can't for the life of me figure out where or how to get rid of them. I'm using Xcode 4.5.2, iPhone 5 iOS 6.0.2, OSX 10.8.2 fwiw.
Yes, alternative 6 and 7 do work but I can't spend hours on restoring my iPhone to factory settings or recreate my entire Xcode project every time this happens. Alas, it does happen quite often these days.
Any other ideas or suggestions?
Upvotes: 4
Views: 1275
Reputation: 2983
Thanks to gmogames for pointing out the following solution which did the job for me.
In Xcode press:
Option + Shift + Command + K
Upvotes: 3