alex
alex

Reputation: 1089

Cocoa Touch Class can't find default Group or Target for my project

I'm going through the basics and following the RoadMap iOS Start Developing iOS Apps Today guide. In the Tutorial: Storyboards chapter under the heading Create Custom View Controllers, it explains how to create a new Cocoa Touch Class called AddToDoItemViewController.

Step 8 explains how the save location will default to my project directory, the Group option will default to my app name, and in the Target section, my app will be selected.

However, none of these settings are defaulting for me: Creating Cocoa Touch Class file

And when I click create, my files are added outside of my Project. .h and .m files added

I can't work out how to change any of the settings when creating these files. Could anyone shed any light on the issue for me?

Upvotes: 0

Views: 362

Answers (2)

bolnad
bolnad

Reputation: 4583

Your not adding your files in the folder that the project navigator is displaying. When you created the Xcode project it made a project folder called TodoList and inside it is your .xcodeproj file and next to that is another folder called TodoList. That is the folder that you want to add your classes to.

Upvotes: 1

reviver
reviver

Reputation: 168

When you create new file, Xcode will use the place where is active (highlighted with blue color) in Project Navigator.

Since you are viewing project top, then your file is created there, but you can change the file path and belonging group before you click create.

If you have already created in wrong place, that can be corrected:

  1. Move you newly create files in right place by Finder.
  2. The files moved in step1 will be in red color in project navigator since Xcode can't locate it. Open Utilities and select File Inspector tab, click the little folder icon (below Location, above Full Path), and choose the new file location.
  3. Rearrange your group if necessary.

Upvotes: 0

Related Questions