All of my views are being deleted from IB

For the last hour I have added and readded my views to IB and after test running the app on my iP5 all of the views vanish from IB. The app with all of its views are still showing on my iP.


I have restarted Xcode twice and this did not help. I will try restarting my Mac and see if that helps.


I am using Xcode 7 and Swift 2.


Any help will be appreciated. Thanks!

Answered by easyStreet in 85368022

It looks like you used the LaunchScreen.storyboard. You should be using Main.storyboard for your app design.

More strange behavior.


I relaunched my Mac and re-opened the same projects I was working on:


1 first thing I noticed was that the Utility pane's object library panel was blank. I brought the other opened project to the front and its utility pane did not have any objects to choose from either. Typing 'button' or whatever got a 'No matches' result. Then all of a sudden the utility pane of the first project came back to life, the seond one did not;


2 I relaunched the app on my iPhone and it showed the orginal layout as it should;

3 I re-ran the same app with its new views from Xcode and the new layout appeared for a second or so and then the original layout appeared and remained in view;


I just opened the storyboard of the second project and the utility object pane came back to life. I also deleted the app from my iPhone and re-ran the original app and once again, the second layout (the one that I can presently see in IB) appears for a second then the old deleted layout appears.


If anyone has any idea what is going on I would like to know your thoughts. I may have to delete Xcode and download a fresh copy.


Thanks!

Just noticed in another thread that I am not alone in this. Great!


For the record I am using Xcode 7.0.

Just downloaded Xcode 7.1, but it is only 344 KB! I am now trying to download it again from the app store.

Going to be another long day or so it seems.

I have severa; issues today:


1 I have downloaded Xcode 7.1 twice today and what ends up in my App folder is a new Xcode icon that is only 344 KB in size;

2 Looking at the App store pane, it continues to show 'Installing' even though the new app icon is already in my app folder. This may or may not be normal installation procedure;

3 Today, using Xcode 7.0, I built a quick test app with labels, text fields and buttons, saved and launched it on my iP4;

4 When the app opened I saw the layout I had just created and then all the components vanished from view..


So, now the question is - do I continue with the Xcode 7.1 install ( if I can get that far ) or wait for install the latest Xcode beta that is availablle for download?? As it stands I am making zero progress with Xcode 7.0, so I have no idea how to proceed.


Any thoughts on this from anyone would be most appreciated.


Thanks!


P.S. The 'Xcode and iOS SDK License Agreement' pane just popped up on my screen. I will hold off agreeing to this until I get some advice from this forum. Thanks again.

You're basically holding a discussion with yourself here, but - you only ever directly download & install XCode from the one and only verified source there is: Apple.


If you did download your copy from Apple, there isn't any reason not to follow through with the installation.


The items disappearing from the Utility pane - I've had that since seemingly ever. It is irritating, but always remedied easily by switching between open files or at worst restearting XCode.


Your other issues are hard to follow, given you mix them all up over various posts.


"Things" persisting in test apps where they shouldn't are usually avoided by:

- Clean Project

- Clean Build Folder

- Clear the content of the "Derived Data" Folder


Also if you've downloaded XCode and it only has 344kb then you know you haven't downloaded XCode.


Last but not least - are your added subviews "deleted" in Interface Builder or are not not visible?

My guess is - not visible (which basically is the thread where you came from).


So - are they visible in the document outline (the column left of your Interface Builder where all document elements are listed in a hierarchical view) or not?

If so, they're not deleted.

Thanks for your post.


I have now sucessfully installed Xcode.7.1.

I built a new test app and added buttons, text fields, etc. to the storyboard

I ran it on my iP and the components appeared briefly then vanished.

I opened the Product menu and pressed the Option key and the Clean menu item changed to 'Clean Build Folder...' but it was grayed out.

I then tried Cmd+Optn+Shift+K and that did not empty the Derived Data folder

i then went into my Library/Dev/Xcode/Derived Data and manually trashed all the files save for two files: 'ModuleCache' and 'myAppName-frwib...' that could not be moved to the trash.

I also trashed all the files from the apps Build folder

I deleted the app from my iP and ran it again from Xcode 7.1

When the app launched on my iP it once again displayed the correct layout for a very brief time and then all of the components vanished.


Not sure what else I can do except perhaps wait for the release of Xcode 7.2.


Thanks!

"I ran it on my iP and the components appeared briefly then vanished."


So you're running it on your iPhone (I'm guessing that's what 'iP' is), the UI elements appear and then disappear? Sounds like something isn't being retained. That isn't Xcode's fault, it's a coding error.

Thanks for your post.


There was zero coding involved. I wish that was the problem.


All I did was add buttons, text fields and labels etc to IB and then just ran the app on my iPhone. That is my normal habit just to take a look at the layout before I begin with the coding. This has happened with both Xcode 7.0 and 7.1. If I am doing something incorrectly I have no idea what it is.


This problem began yesterday after coding for several hours. I have no idea how to proceed to figure this out.


Thanks for your suggestion.

What model iPhone? Which launch image is spec'd? Is it possible the simple/generic layout isn't honoring bounds and putting items off screen?

I learned today that CTRL dragging from a UI component to the .swift file using the Asst. Ed. no longer works. So, I deleted both Xcode 7.0 and Xcode 7.1, downloaded both and re-installed them. After launching them I got the SAME EXACT RESULTS that I have been having since Sunday - i.e., components added to IB will vanish from the app when run on either the simulator or an actual device.


Does anyone know if there may be some Xcode setting that could be causing this strange behavior?


I am upgrading my 24" iMac to El Capitan and downloading Xcode 7.1 because I really think I have some hidden issue with the 27" iMac I am currently using.

Here is a video showing the behavior of Xcode:


https://vimeo.com/144766455


You will note that not only are the IB Components vanishing, but the ViewControllers View is also dissappearing.

Accepted Answer

It looks like you used the LaunchScreen.storyboard. You should be using Main.storyboard for your app design.

When I received your post I thought - No way am I using the LaunchScreen.storyboard! No bloody way. But thinking about what you suggested made perfect sense because the behavior matched that of the LaunchScreen.storyboard. So I took a look at the video I sent Apple and could not believe my eyes - I was in fact grabbing the LaunchScreen.storyboard!


I wanna go and hide somewhere. I have absolutely no excuses.


All I can tell you is THANK YOU! for spotting this. I don't know if you caught that in the video or just made an educated guess. Either way I am very grateful to you.


Pizza's on the way!!

All of my views are being deleted from IB
 
 
Q