How can I add file to project in Xcode 9?

Viewed 11052

I created a new project in xcode 9.

I want to add image file to project.

enter image description here

enter image description here

When I delete this file from desktop,

Image file appears in red?

enter image description here

But in project folder, I find this image file.

enter image description here

In Xcode 8 its working fine,

Any idea?

5 Answers

I have seen this issue in Xcode 9.0 GM (build 9A235, same as the current release). It's intermittent; sometimes 'Copy items if needed' is honored, sometimes not.

In one case it seemed to be triggered by the presence of source control. I was working through an online tutorial where the provided project had no source control. Adding files here did honor the 'copy items' checkbox, but if I made the provided project a git repository first, adding files ignored the checkbox every time.

Related