user3661956
user3661956

Reputation: 49

Xcode can't find my .h file that was made in the project

enter image description here

Disregard the typo in the body of the @implementation where the view controller being called is different than the one being imported. I've fixed that and the error still occurs..

I can't figure out why it doesn't find the file when the file is clearly within the project..

And it does this for every file that is in the Models, Views and Controller files..

Upvotes: 0

Views: 129

Answers (3)

Kjuly
Kjuly

Reputation: 35131

I press OptCmd+a to add the folder and got this issue.

A simple image to solve the issue:

enter image description here

Make sure you selected the "Create groups", I must clicked the "Create folder references" by mistake sometime before

Upvotes: 0

ThomasW
ThomasW

Reputation: 17307

The problem is that the "Controllers" folder is a folder reference and not a group. That is why it is blue and not yellow like the other groups in your project. Remove the folder reference and add the "Controllers" folder as a group to your project. To do this, when you drag the folder into your project, in the dialog that appears make sure to choose "Create groups for any added folders" and not "Create folder references for any added folders". The "Models" and "Views" folders will also need to be fixed.

When you have a folder reference the files will be added to the product of the target, but not compiled.

Upvotes: 1

TheCodingArt
TheCodingArt

Reputation: 3429

  1. Don't attached imgur pictures... You can attach them inline with your post.
  2. Ensure that your header is included with the linked headers under the build information.
  3. Run a clean build and ensure you're running the regular target and not the test target.
  4. If your file is included during compilation (aka your build settings include it) then restart Xcode.

Upvotes: 0

Related Questions