How to correct changes to my app made by an xcode freak-out? - ios

I have an xcode project for an app I am in the middle of developing. Recently I saved my xcode project, and then moved a single button using the arrow keys, somehow causing xcode to crash. Several re-opening attempts failed, as I saved just prior to the crash, and xcode would then simply crash upon opening.
After restarting the computer to no avail, I opened the project in xcode 5 developer preview, didn't upgrade the app to xcode 5, and then was able to open it in xcode 4 again. However, for some reason a bunch of IULabel I had created with important text were missing. After closer inspection, I found that I had some UITextFields that were also missing. When I inspected the connection in my header file, I could right click the outlet and select the UITextField. It turns out the X coordinate was set to -345, so it was missing because it was out of my view.
I suspect all of my missing UILabels are similarly out of my view, but since they aren't explicitly connecting to my header, I have no way of selecting them manually, and I can find any way of searching for them or selecting them, since they are out of my view.
Does anyone know how I might be able to select these missing UILabels so that I can change their faulty X coordinates?
Thanks!

All UI elements you have used in your storyboard/xib should be available in the left sidebar of the interface editor.
If the sidebar is not visible you have to click the little round button at the bottom.

Related

Issue in loading StoryBoard [duplicate]

I have updated by Xcode to Xcode 11 Beta and have updated the build settings from iOS 12.2 to iOS 13. Everything is working perfectly but the viewcontrollers in Storyboard appear black. The components of the viewcontrollers are present but it is difficult to preview due to the black screens
Had this same issue, eventually tracked it down by cut-pasting elements from the black screen to a brand new view controller and see which ones cause the new one to have the same error, or caused the old one to render.
After fixing it, the diff ended up being a background image on a specific UIButton.
I found that after updating to Xcode 11 if one element has an issue, it breaks the whole storyboard like your screenshot.
I had this issue last night. My UITableView was expanding too far out of the screen on the right hand side. I dragged it back into the bounds of the UIViewController parent and updated the right hand side constraint to be 0.
So check if anything goes beyond the UIViewController boundary that shouldn't.
In Xcode 12.4
After trying lots of thing, finally i resolved my issue
First close your project.
just goto finder -> Application -> Xcode -> get info -> uncheck open using Rosetta
Now, simply open your project.
Just delete any constrain in that viewcontroller and then undo the change.
Check the values for the cell heights. In opening an older project, the row height (in the TableView itself) was 0. Changing it to a positive value or deleting the value (so it defaults to automatic) fixed the issue for me.
I had the same issue, here are the steps I followed.
Clear constraints, for my case the source was from UITableView, and make sure constraints are attached to safearea not superview.
From the toolbar on the top, go to Editor > Canvas > Layout Rectangle. It is very important to repeat this step 3 times.
Once finished, quit XCode and reopen it again and everything should be fixed. I've noticed this happens when I'm switching views for different devices 8, 11, 4s.
I don't know exactly what the problem was, but I was able to solve it with the following steps.
Run 'pod install' to install all cocoapods dependencies
In Xcode: Product -> Clean Build Folder
Restart Xcode and run the project

xcode 6.2. view controllers greyed out, locked

I have a xcode project with buttons and other objects in it. But the objects are all greyed out in my view now. The project still compiles and shows the buttons fine. I saw posts about using auto-layout, changing size-classes, and modifying the IB. But whenever I make any of those changes, a lock icon shows on the screen and nothing changes. I can go back to an old version of my code, but I'd rather find out what will fix the issue.
What was I doing to break it? I was just exploring through the different xcode windows and views, and don't know exactly when the viewcontroller objects became affected.

Xcode Main.storyboard not showing what appears in the iOS simulator

I am working on a project with other teammates so we have be storing our project on the cloud as a zip file. After unzipping the file, Xcode does not display the main.storyboard correctly; won't show buttons, labels, images, etc. However, when built using the simulator, all of these display correctly. In Xcode I can access them and change them but am unable to delete or move them through the main.storyboard. Any ideas or suggestions to fix this inconvenience?
I think this is because the view controller is locked to prevent editing. Try unlocking it by
Select Identity Inspector of view and set Lock to Nothing

Different Object Library In Xcode

Notice the object library in the attached screen shot, at the right bottom.
It's different to the usual one I'm used to work on, I clicked to open an XIB and it was gone and I don't know how to get this one back. Is it even useful ?
I scrolled through it and found many more controls like Bevel Button, Secure Text Field....etc.
Those are elements for OSX. Xcode seems to to know that this is an iOS project if no Interface Builder file is opened. If you open the Interface Builder, Xcode realizes that this is an iOS project and only shows iOS elements.

I opened Xcode 4 project in Xcode 5. When I open the view that was opened in XC5, the labels and buttons are not showing, How can I fix this?

I have a project that is xcode 4.6.3, and I inadvertently opened the project in xcode 5. There was a xib open, and so it changed it to default to ios7. I already changed it to open with xcode 4.6 in the interface builder section so that isn't the problem. The problem is that xcode 5 changed the UI so that now the labels and buttons do not show on the XIB. I can see them in the object explorer, but clicking on them does not bring them into focus on the XIB. How can I make them show on the screen again?
This happened to me too. Check the X and the Y frame values for your labels, buttons, etc. For me they were set to crazy values like -1543 for some reason. I haven't figured out why yet. But if you change the X and Y values back to something within the view's frame, they'll show up. Hope this helps.

Resources