9

I have a big iOS-project with many folders / groups. When I quit and restart Xcode, all folders in the Project Navigator are shown expanded, so I have to collapse most of them manually.

Is it possible to save the state of the Project Navigator, so that when Xcode restarts the same folders are collapsed / expanded as before?

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
A.G.
  • 2,037
  • 4
  • 29
  • 40
  • That is the default behaviour. Works fine for me in Xcode 5 - which version are you using? – Jay Oct 07 '13 at 17:17
  • 4 years later, this problem still plagues Xcode. Deleting `UserInterfaceState.xcuserstate` buys me a week or two at best until the bug resurfaces. – trndjc Apr 11 '18 at 21:40
  • This is a bug and still unresolved. Please dupe the issue at http://openradar.appspot.com/32787072 on http://bugreport.apple.com. Concerning that this has been unresolved for five years. – Tricky Jun 21 '18 at 22:34

2 Answers2

30

The solution was to delete this file:

MyProjectName.xcodeproj > project.xcworkspace > xcuserdata > myusername.xcuserdatad > UserInterfaceState.xcuserstate

This file was recreated by XCode when re-opening the project.

Apparently that file got corrupted when XCode crashed. (Its size was 300 KB instead of the usual 10 KB).

To see the files right click on MyProjectName.xcodeproj, and choose Show Package Contents. You will find UserInterfaceState.xcuserstatein the subfiles.

clemens
  • 16,716
  • 11
  • 50
  • 65
A.G.
  • 2,037
  • 4
  • 29
  • 40
  • What you mean delete file MyProjectName.xcodeproj > project.xcworkspace > ...? MyProjectName.xcodeproj and xcworkspace are files but not folders... – zzheads Oct 12 '17 at 06:32
0
  1. Project Navigator > search file (enter a random sting), shows 'No Filter Results'.
  2. Close project.
  3. Reopen project.
  4. All folders have been reset.

enter image description here

Mick
  • 30,759
  • 16
  • 111
  • 130
Cry
  • 21
  • 1
  • 2