Why do my files keep disappearing from xcode's project navigator?
Asked Answered
I

6

15

The project I'm working on started as a single view application with storyboard, and I've added 2 more view controllers, each with a .m and a .h file. However, every time I save, quit, and then restart, the 4 new files disappear from the project navigator. I have to hit "add files to project" and drag them in manually from the project's folder each time. It's not terribly inconvenient, but it's annoying enough that I've basically just been leaving the project minimized whenever I'm not working on it. Does anyone know what's going on, or how I can force the files to remain in the navigator? This kind of thing has never happened before.

Instate answered 11/1, 2013 at 19:27 Comment(3)
Are you saving the project after doing this?Chevaldefrise
Try clicking the option "Destination: Copy items into destination group's folder" and make sure to also select "Create groups for any added folders". Another question worth asking is: "Are you using any kind of source control?" (Maybe your project file is locked form some reason)Uprise
Those are both selected. I'm not sure if there's any kind of source control. I haven't set anything personally, but maybe something turned on by itself when I dragged in a couple of files that I downloaded from the internet (and then subsequently deleted)? @LucWollantsInstate
S
47

there is a button on the filter bar to "show only recent files"; the icon looks like a clock. You need to toggle this button to show all of your files.

Seagirt answered 24/1, 2014 at 3:21 Comment(1)
For me it wasn't the clock for recent files, but another item I found down at the bottom of the Project navigator by the clock - I had one letter accidentally typed in the search field and so it only showed some of my filesBallarat
T
16

You probably are having a filter to show only recent files. To toggle that,

enter image description here

Truant answered 13/7, 2017 at 3:56 Comment(3)
You are a freaking genius :-)Satin
I updated XCode, restarted my machine, but nothing happened. Finally this worked :)Nicko
That is smart and I am definitely not!Strawflower
H
5

There is a button(4th one) on the filter bar- the botton portion of project navigator pane-, where you can toggle between "On/ off " for "Show only files with unsaved changes " . You probably have it "On". click that button and you probably will see the files

Hutton answered 12/1, 2013 at 1:25 Comment(2)
Nope, that was one of the first things I checked.Instate
Was having a heart attack and this saved me, thank you.Lights
S
4

Click on Navigate at the top menu. Then click on "Reveal in Project Navigator."

Stoush answered 31/7, 2015 at 23:16 Comment(0)
G
1

Well you might have accidentally clicked on the bottom 'show only recent files'.

At bottom click on the blue icon which is for showing recent only

Getupandgo answered 8/12, 2022 at 14:41 Comment(0)
B
0

This is so weird. I discovered that the reason I could not see files in my project using the Filter was because I had inadvertently collapsed the tree under the base directory of my project, evidently while the Filter was active. enter image description here

If you close it and then try to filter, it works. But if you close it while filtering is happening, it remembers this going forward. I guess there are scenarios where this would be helpeful...

Brassiere answered 5/8, 2021 at 14:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.