Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There are a few options for using CLANG:</p> <ol> <li><p>Run build and analyze, to see clang results.</p></li> <li><p>In project settings for a configuration, you can check the "run static analyzer" box and CLANG will be run each time you compile.</p></li> <li><p>You can also change the compiler from GCC 4.x to CLANG/LLVM. That displays more errors and CLANG warnings (one example is that <code>NSLog(@"A value is %@:%@", value)</code> will warn you you are not passing in enough parameters).</p></li> </ol> <p>I would recommend option 2 - if you run the static analyzer with each build, it doesn't take much more time and you'll find out if you are doing something odd right away, rather than fixing a bunch of errors later. The clear messages it give you actually provide a lot of educational value, so it makes even more sense to turn it on if you are just learning!</p> <p>Option 3 is good to run from time to time because of the greater error checking. However, currently XCode has no CLANG/LLVM compiler for the iPhone device, and so you can only use that setting when compiling for the simulator. The best approach then is to create a copy of the debug configuration (in the project settings configurations tab) named "Debug CLANG", and set that configuration to use the CLANG/LLVM compiler and run the static analyser. Note that after you create a new configuration you have to back out of settings, select it as the active configuration (via the top right dropdown) and then go back in to project settings to edit the values. </p> <p>Then in day to day use you simply use the "Debug" setting to compile using the static analyzer, and switch to "Debug CLANG" perhaps once a week to see if any deeper problems exist.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload