When you open Xcode 4 and ignore the new project window, it doesn't appear possible to simply create a new file. You must create a new project first. Is that true?
I seem to recall that in Xcode 3.x, I could simply create a new C file and get coding/practicing. It would also give me an option to ignore auto-creation of a 开发者_StackOverflowheader file.
Am I getting something wrong or am I remembering Xcode 3.x incorrectly?
I'm working through Scott Stevenson's "Cocoa and Objective C - Up and Running" book and really only need the most straightforward way to create and play with single C files without having to create bulky projects around them.
I don't know if it is possible to create a C file without a whole project. However, it is possible to edit a C file with Xcode, without having a project. So, as a workaround, you can create an empty C file with whatever tool you want, double-clic it and it will open with Xcode.
Or, if you prefer, you can use the console to do it:
$ touch empty.c
$ open empty.c
The file empty.c should be created and opened with Xcode.
You can't create single C file in Xcode. All you have to do is Click on the Project Navigator and click on top icon showing project name and the no of targets. Click on the icon and set the compile sources. Now you can't place more than one files in the compile sources unless they are linked, so you need to remove the file which is already there and add the one you want to run. That's it. Good luCk!
精彩评论