Is there any way to compile a single file in Xcode 5?

10,344

Solution 1

Or if you want a shortcut: CTRL + COMMAND + B.

Solution 2

In the top menu of XCode "File - Edit - View" you will see Product.

Click Product->Perform Action->Compile "myfile.xxx"

If you want a shortcut for that command, click XCode -> Preferences-> Key Bindings and set one up.

Share:
10,344
Straightfw
Author by

Straightfw

Updated on July 11, 2022

Comments

  • Straightfw
    Straightfw almost 2 years

    I'm talking about a functionality such that you can just quickly open a .cpp file (C++ console application, nothing regarding Apple ecosystem), work on it, compile and run, without all the project creating mumbo-jumbo. When I open a file with code, all the "Product" options are greyed out for me but after some googling, I found posts claiming that Xcode 5 was to be the first one offering such functionality. Has it been implemented and it's just available elsewhere or were they false rumors and you still have to create a project and import a file there?