hello,
Its been a long time since I used XCode, but if I remember there is a a part of it installed with OSX System, and then I guess in your environment variables the one registred is the OS one, take a look there or if VisualStudio on OSX need certain environment
variables to be set, also check if there is any other version of XCode installed on your System, here is an article about
using multiple version of XCode on your system, take a look at this section :

hope it help;