Xcode comes with the excellent Clang static analyzer. It helps to automatically find bugs such as memory leaks as well as unused variables.
Run it with the menu Product > Analyze. Use it!
Your feedback is valuable: Do you want more nuggets like this? Yes or No
.