How can xcode can switch to the error pane when building or running fails because of an error in my code?
In Xcode preferences select the Behaviours tab, the select "Fails" in the Build box. On the right select Show Navigator and set to "Issue Navigator";