Storyboard corrupted - xamarin

I've experienced a strange problem today. I was working on my iOS app in xamarinstudio. A modification had to be made in one of my viewcontrollers, so i opened up my storyboard to see that most of my viewcontrollers were missing! The connection between viewcontrollers was still there, in fact, my app still works, but most viewcontrollers are missing. When you open the .storyboard file in a texteditor, you can clearly see that the missing viewcontrollers all have their width & height properties set to 0! This happened suddenly, without any warning. I can't even remember exactly when this happened, because i didn't open my storyboard file right away. The only two things i did differently that day is execute the updates for Xamarin studio, mono, xCode, the emulator & iOS and i modified a .xib, so i had to open xCode. Here is a screenshot of what my storyboards looks like now:
Has anybody encountered something similar? And how did you fix it?

Try opening Storyboard as code (2 finger tap) and look around to see if there are any view controllers present. Maybe the size was corrupted to zero? You can edit that inside storyboard.

Related

Xcode Storyboard layout anomaly, bug or something else?

I"m seeing an anomaly with the storyboard in my project and not sure if it's a bug or something else I'm doing wrong. Within a UIViewController, an element may or may not start shifting its position to the left and down by one each time the project is opened. It doesn't happen everytime the project is opened. It's not limited to any particular type of control. These screenshots of are a UIScrollView, but it happens on UITableView, UITextView, etc.
I'm not using autolayout. I haven't filed a bug report yet.
thanks for anyones help!
If you remove the horizontal and vertical stretchable properties of autoresizing and handle the stretch in subviews then you will be able to fix this bug. I have tried this hack and it was not changing the frame on quitting and re-opening the Xcode.

Weird NSOutlineView crash

I'm experiencing weird crash in NSOutlineView: when i click "collapse" button, app crashes immediately and even "exception breakpoint" doesn't help to see where the problem is.
I've tried to run app without debugger, and reproduced the problem. Once app crashed, i've got OSX crash window and was able to extract crash message from there:
The window has been marked as needing another Update Constraints in Window pass, but it has already had more Update Constraints in Window passes than there are views in the window
there also call stack, but it won't help since crash happening inside libsystem_c.dylib, so i'm not posting it here.
It seems there is something wrong going with auto layout. Absolutely have no idea about next steps. Please give me an advice!
Also, one more thing, that began only after update to OSX Mojave.
After hours of debugging and testing, i noticed that that message is caused by "infinite layout loop".
Different code, related to outline view was causing NSSplitView to layout. And delegate method - (CGFloat) splitView:(NSSplitView*)sender constrainMinCoordinate:(CGFloat)proposedMinimumPosition ofSubviewAt:(NSInteger)dividerIndex has been called about 200 times prior to crash.
It's hard to catch this bcs it's not actually infinite recursion, so just debugger doesnt help a lot.
I just added simple code that helped me to identify the issue:
static int a = 0;
NSLog(#"Layout: %d", a++);
Hope my experience will help somebody else!
For anyone who is having the problem in Xcode 14 and macOS using SwiftUI:
I just had the same crash by hiding a view with an animation. My main view contains two views, one view contained an empty ScrollView, which didn't cause a problem by itself, but by changing it's size it crashed. Just adding a basic Text within the ScrollView solved my problem and the app doesn't crash anymore.
I updated my build to IOS 14 and Mac OS 20.15.6 and the error went away.
try turning off 'Use Auto Layout' checkbox in nib (in File Inspector tab).
May have to disable it for each and every view.
Also, unrelated, but Mojave forces you to use Core Animation.
Most of my nibs have 'set wants layer' turned off.
However, in one of my nibs I had a stray setWantsLayer checkbox checked.
when I unchecked it, the view (NSSearchField) drew properly

xcode storyboard mirroring effect

Am using Xcode 9.1 and my Xcode error while dragging objects from object panel in storyboard its mirroring automatically as shown in picture .need help in solving this !
Very odd. At first I thought it was simply rendering for a RtL locale but I don't imagine the chrome around the rendered view should be mirrored as well. Out of curiosity are you testing a Right-to-Left locale? If so, does this persist when that preference is disabled?
Otherwise I'd try cleaning the project, restarting Xcode, and removing your .xcuserdatad file, in that order.

Constraints keep going haywire every time I reopen an XCode project

Every time I close and reopen XCode 6 beta 6, my previously-happy constraints are messed up and I have to click on the yellow dot to get to the "Misplaced Views" thingy, then click on each yellow triangle, choose Update Frame, and click Fix Misplacement to correct the problem. Is this a bug in the beta or have I done something wrong, perhaps? Constraints in XCode (to me, at least) are horrible things to tame at the best of times, so maybe it's not a bug?
Once fixed, and XCode neither complains about nor renders the widgets badly, it's fine. But as soon as I close then reopen the project, they're messed up again.
I have experienced the same thing on a project I'm working on. What I've observed is a circular connection among the views in the storyboard in question, so that it's possible to segue around and around a particular path or paths. The views are all embedded in a TabBarController, and each tab has its own NavigationController.
So for instance:
Activity View (programmatically selected tab), segue to ...
Detail View, segue to ...
Profile View (programmatically selected tab), segue to ...
Item View, segue to ...
Detail view
... and so on
This seems to introduce random screwups to the views.
What I have not yet done is test this by removing the circular segue paths. I'm not sure I ever will, since the circular segue paths are part of the functionality of the app. But I'm pretty sure that was about where this weird behavior got introduced. I'll be interested to hear whether the same is true of your project.

Not seeing my view in simulator using XCode 4.2

I have downloaded Xcode 4.2 and I'm having problems viewing my project in the simulator. I'm getting a blank whit view when I run the simulator. I'm using a single view application. I created a interface .h, .m, .xib... I have connected all actions and outlets and saved everything. My thoughts are that I have overlooked something simple. again, I just started using Xcode 4.2 today. Help!
I am assuming you are not doing this
if((self = [super initWithNibName:#"MyClass" bundle:nil])) {
// do stuff here
}
This isn't enough information to tell what's wrong with your code.
That said, if create new project in XCode using the "Single View Application" template you can see how everything is hooked up and you may be solve your problem with a 'how is mine different?' comparison.
If that fails... post some code and we might be able to see the issue.
Edit: From your screenshot it looks like you are mixing storyboards and XIBs. If you are using storyboards, then you won't see .xib files. They are inside your storyboard. You can click on the storyboard file and edit the first XIB which loads when your app runs as well as create new ones. You can still do things the "old" way by just unchecking storyboards when you first create the app. On a side note, it is possible to mix storyboards and straight XIBs, but I don't think that's what you were going for.
At a guess, you created a project with storyboards, then added a XIB manually and you get a blank XIB. Try clicking on the storyboard and modifying the XIB in there. I bet they will show up when you run your app.

Resources