.m and .h files not being added to target

When I add a new controller or cell, there is no choice on adding said files to the project's target, then the complier complains that the files cannot be found.

Replies

If you select the file and open the "Assistant Editor" pane on the right side of the main Xcode project window (using the button in the toolbar or the menu View>AssistantEditor>ShowAssistantEditor), one of the sections in the File Inspector has checkboxes which let you manually set which Targets the files should be added to.


Sorry, but I don't know why you're not getting the option when you create the files.

Can you elaborate on exactly how you are adding the file to your project?

If you are using the El Capitan seed, be aware that application-specific options that are added to the save sheet are now collapsed by default. There is an "Options" button in the bottom left of the save sheet that will disclose them. Xcode puts target membership choices and group coices in those options when creating new files.

Can you explain little more? What I see now when creating new .h and .m files for example tableviewcontroller it's no longer created inside the application folder but rather at the top of the list and can't move then inside. This is little weird.

I have exactly the same problem. Nothing listed in targets when you create a new file and it is placed at the top of the list. I have to remove it and drag it back in for it to be included. Very annoying.