Clang works by looking at your code before you run it. Using Clang, you can easily identify memory leaks, uninitialized variables, and other bugs in your code.
Using Clang is really simple since it is built into Xcode. To have Clang analyze your code, just select Build > Build and Analyze from the top menu bar in Xcode. Click the Build Results tab in the Editor window to see the results. Selecting each item in the list will take you to the line of code where there is a potential bug. Pretty nice, right?
To see a real-world example, analyze the EveryDayCounts application by following these steps: