Project-Prefix.pch file in Xcode 6 - xcode6

In Xcode 6 the .pch file is not created automatically for you anymore. I understand there are steps to create the file on your own. My question is, should the .pch file be added at all?
Did Apple move away from the .pch file completely? Or is there a new convention used to store all #import statements?

Related

Xcode autocomplete broken for .mm files

Since there's no way to directly create .mm (Objective-C++) files in Xcode, I just create a CocoaTouch Class with Objective-C and rename the .m file to .mm file. However it seems the code autocomplete functionality is completely broken for .mm files, for example after I type "NS" I expect a list of "NSArray", "NSString", "NSLog", etc. etc. to show up, but now it only shows some code snippet shortcuts like "nsenum" and "nsoptions". If I rename the extension back to .m, the autocomplete works correctly again.
Now I wonder if there's some setting in Xcode to make the code autocomplete functionality work correctly for .mm files? So far I have not found any relevant setting, and keep renaming the extension back and forth between m and mm is really tedious after a while.

Is it possible write some code that forces xcode to save all or specific files?

I'm trying to make a plugin that writes something to the .h file with a key command (⌥ + c) while I'm coding in the .m file, e.g. I'm writing a method I want to be exposed, I press my key command at the end of the line, and it automatically writes it in the .h file without me having to copy and paste it over.
If I've just made a change in the .h file and go to my .m file and use my plugin directly after, I get an error popup saying that Xcode has changes that is not on the disk yet, and then asks which version I want to use, the one on the disk or the one in Xcode.
If I'm only coding in the .m file and adding the methods and properties to the .h file with my plugin it works fine (because I haven't made any changes to the .h file manually it seems), it's only when I've just made some changes myself to the .h file and go back to the .m file and use my plugin directly after that I get an error.
If I'm changing something in the .h file and then press ⌘+s and go over to my .m file and use my plugin it also works as intended because I force it to save whatever is in the .h file now. But pressing the ⌘+s command from the .m doesn't help my case, so it seems to only save the current file you're working on, be it the .h file or the .m file.
So my question is, is it possible to make some lines of code which forces Xcode to save all files (or just the .h file if that's possible, I have the, I have the filename and the path), so I'm sure Xcode and the data on hard disk matches up before the plugin makes any changes to what is already on the hard disk?

Including C Program into OSX Application

I am working on a Mac OSX application in Xcode 4 that will read and display data from a program written by someone else in C. How can I put this code into my project? Do I have to create new Objective C files and then "rewrite" the C program into these ObjC files? Or can I simply include the C file in the project and reference it from other files? I have tried the latter and it didn't work, but I'm sure I was doing something wrong.
Thanks
You can do:
File->New File->Under "OS X" heading in Xcode, "C and C++" option has an option of adding a .h, .c, or .cpp file (all of which work with Objective-C).

How do I make Xcode open .h first rather than .m files?

When creating a new class in Xcode the default behaviour is to open and display the implementation file (.m). How do I make Xcode open the header (.h) file first? I often find myself often needing to alter the .h file first to change things such as member variables, properties and inheritance.
As you add a new class, the first file that gets added is .h and last file is .m.
And XCode opens the latest file for you which is .m. Now you want to make it reverse, which is not possible unless some tweak or hack, but the best practice would be to use Ctrl+Cmd+Up or Down to switch between .h and .m

Problem renaming xcode classes

i'm trying to rename my classes in iOS project in xcode but i cant.
If i try to rename the file in navigator, or if i make refactor -> rename on class name in .h file, it replace all except .h and .m file, it say me:
"Unable to rename oldName to newName, oldName couldn't be moved to appName"
How can i solve this?
Thanks.
Type in the name of your project in the finder, and locate the class files and header files inside that. Try renaming it through that