Are you sure it didn't have to do with your IDE? Or are you strictly using the console? Because apple command line syntax is not the same as Windows command line syntax.
That said, I'm pretty sure programming in Objective-C, Swift, and iOS are perfectly Mac friendly. š There was actually a time when you actually literally couldn't code in those languages on a PC, but I THINK that has since changed (not sure about that though).
Or it could be your compiler. For newbies it can be complicated figuring out how to get a compiler to work.