get black screen when opening UITabViewController - objective-c

My app opens to a UITabViewController. It has 3 UIViewControllers a,b,c as the tabs, connected by a Segue.
It used to work fine but something happened and now when I run my program, the tabs are displayed and it seems that the controller is working (with NSLogs the viewDidLoad of the first tab seems to run) but except for the tabs the whole screen is black and nothing is displayed.
It seems that this happens a lot, but I've tried all the suggestions and so far nothing has worked.
Looking for possible advice on how to deal with this, thanks!

try to change the view's backgroundcolor of each viewcontroller.

Are you selected starting point in storyboard like this
enter image description here
This is one major reason for black screen.
Second one background image, third one background view colour.

Related

Error displaying Tab ios

I'm trying to create an app with two tabs. When I get to the scene where I can choose between tabs, the first one (the one which is loaded automatically) is showing as desired. But, when I click the second tab, it goes behind the Navigation Bar. Both Controllers have the same configuration, as far as I know. I can't find the problem here.
If I swap the order of the tabs the issue is the same. It looks like that the problem is with the Tab Bar Controller.
What can I do to fix it? Thanks.
you can do
self.edgesForExtendedLayout = UIRectEdgeNone;
on your -ViewDidLoad Method of the 2nd view

Xcode why does my UISwitch not work after awhile?

I am using a UISwitch in one of my tabbed applications. The UISwitch is on the bottom of the screen. When I first start the App, the switch works fine. I can rotate from portrait to landscape, everything works fine. I can even go to other tabs and come back and the switch still works in both landscape and portrait. However, if I go back and forth between tabs maybe five times, the switch works in portrait, but not landscape . Has anyone ever seen or heard of this? Anyone know of a reason this could happen? I have used
[infoSwitch setOn:NO];
in my viewWillAppear, so that the switch always starts OFF. Is there something I am missing about using a switch? I did the same things I have done in the past to get switches to work. Any help will be much appreciated! Thanks again.
UIViews may be visible but will fail to get input if they're outside of the bounds of their parent view. So a first diagnostic would be to give the parent view some sort of obvious gaudy colour so that you can see its bounds visibly, then try your rotation and switching to see whether you can force an error there.
You can also set clipsToBounds to YES to ensure that views don't show subviews that are out of bounds.

Fake NSWindow with a NSView inside a NSMenuItem

Before I start I should say I know this seems like a long shot, however I figured it was worth a try.
One app I am working on right now is a Mac Statusbar App. It has a NSStatusItem in the menubar and when clicked it will display a custom window with a popover appearance (like on iPad or like Fantastical has on the mac.) Anyway I started testing this by inserting a single nsmenu item in the status items menu. The view has set clear color for the background color on its window. However this still doesn't quite work as you can see in the pic below
There is still a small white thin line above and below the item
The clear area isn't clear, its like it has a blur filter on it
Other than that, it works fantastically great. I just didn't know if anybody else has ever attempted anything like this before and figured out how to overcome these 2 issues which seem to be the only thing preventing this from working.
If there is no way to do this I may have to resort to using a custom view for the NSStatusItem so I can get the coordinates on screen to position my own window below the NSStatusItem.
A fake window seems like a rather weird approach to this. Why not just pop up a regular window? I suggest MAAttachedWindow: http://mattgemmell.com/2007/10/03/maattachedwindow-nswindow-subclass

Is there another way than presentModalViewController to show a UITabBarController on just part of the screen?

I have a UITabBarController displaying a number of settings-screens in my app. I want them to be shown on just a part of the screen for layout reasons. In fullscreen, the lists become unreadable (too wide), there are just a few controls per page making the page feel very empty, and the tabbar buttons are far away from the content (Fitts law).
Using presentModalViewController with the UIModalPresentationFormSheet style gives me the size I want. I do this on top of an empty background, since in my case it doesn't make sense to display anything behind it. The "real" working area is displayed with another presentModalViewController in fullscreen mode on top of it all.
This works but feels like a hack. One problem is, I can't make the background behind the settings dialog move in the transition to fullscreen with the UIModalTransitionStyleFlipHorizontal style.
TL;DR
Can I embed a UITabBarController non-fullscreen in another "background"-view? I can't find any information of how I would do this.
Can I embed a UITabBarController non-fullscreen in another "background"-view? I can't find any information of how I would do this.
Why don't you try it out?
Create a container view of the size you want the tab bar controller to have.
Create the tab bar controller.
[containerView addSubview:tabBarController.view];

UITableView became unclickable somehow

I had a working UITableView whose cells are populated with a title, subtitle, and image that was working great and could be clicked on to print something to the console.
In changing other aspects of the app, I or my partner must have somehow messed something up because the table view will still come up when the correct button is touched and gets populated with image and titles as before, but it has become completely unresponsive.
The tiles won't turn blue when clicked, nothing is printed, and the table view won't even scroll when dragged so it's like the is completely unresponsive to all touch events.
I've tried and tried to find out what happened but no luck... Are there any common mistakes or connections I could be missing that would cause this?
Go to IB and check if User Interaction enabled is checked. It must be enabled. If you're creating the TV from code, set the userInteractionEnabled property to YES