Small fixes for Xcode templates

Also, uses `auto` in the template code to be more c++11 friendly
Merge pull request #3701 from ricardoquesada/xcode_template_fixes

Small fixes for Xcode templates[ci skip]