Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode keeps expanding all groups in the project navigator

Tags:

xcode

Since a couple days ago Xcode keeps expanding all the groups and subgroups in the project navigator.

I have repeatedly collapsed them so I can focus on what I'm working on and then I go back and they're all expanded again.

Has anyone else experienced this?

I collapse a group, move to a different tab in Xcode and then back and the groups are all expanded again.

It's really frustrating as I keep losing track of the files I'm working with.

like image 693
Fogmeister Avatar asked Oct 27 '16 11:10

Fogmeister


People also ask

How do I refresh project navigator Xcode?

For a single file, you can open the external file in Xcode and cmd + s to save it, it will be refreshed in Xcode. Also, for the quick way you can just chose the external folder in Xcode and cmd + s , it will refresh all your external file in this folder.

How do I expand all folders in Xcode?

If you hold down the Option key while you click the expand arrow, it will traverse down all nested folders, and open them all up. This also works in reverse if you want to collapse all nested folders. This also works in Xcode!

What is the A Xcode project navigator?

The Project navigator displays your project's files and lets you open, add, delete, and rearrange those files. To open the Project navigator, at the top of your project window's navigator area, click the icon that resembles a file folder.


3 Answers

OK, I had had enough of this now and decided to try several things out.

Xcode had got to the stage where the project navigator was just broken. I couldn't collapse (permanently) and groups and I couldn't move files around or anything.

In the end what fixed it was deleting the .xcuserstate file and restarting Xcode.

I lost my tabs and everything but setting them back up took a couple seconds and everything is working fine now.

like image 106
Fogmeister Avatar answered Nov 15 '22 07:11

Fogmeister


I also was experiencing this annoying scenario in Xcode 9.2 where the project groups kept expanding themselves.

To fix it:

First, close your project in Xcode. (Otherwise, Xcode will replenish this file upon closing the project.)

Then delete the following file (or move the file somewhere else): [MyProject].xcodeproj/project.xcworkspace/xcuserdata/[MyUser].xcuserdatad/UserInterfaceState.xcuserstate

Remember to use the "Show Package Contents" option in Finder.

like image 20
SirEnder Avatar answered Nov 15 '22 07:11

SirEnder


A great shortcut to expand/collapse all Xcode's groups folders is doing cmd + click on any of the group arrow

like image 22
Jorge Casariego Avatar answered Nov 15 '22 06:11

Jorge Casariego