Good evening.
I'm developing for iOS for some years now and I'm experiencing a strange issue ever since iOS8 was released. I was assure it will be fixed but it's 8.1.2 now and it's still happening.
On iOS7 everything is working fine but on a phone running iOS8 something strange happens.
The Problem:
The application turns black randomly. the application is still running as the debugger not firing with an exception. It happens on iPhone 4,5,6 running iOS8 and not on iOS7.
I can not predict the black screen.
I tried opening a new project but the same: random black screen.
Anyone else experiencing this?
Any idea on how to fix this?
It's really annoying.
Thank you so much in advance!
P.S: I'm developing in Swift if it makes any difference.
I had the same problem :
Go to the iOS simulator menu and choose Reset Content and Settings...
Close xCode
Delete the contents of the DerivedData folder (~/Library/Developer/Xcode/DerivedData)
Delete (~/Library/Caches/com.apple.dt.Xcode)
Now launch Xcode…
You can give your main UIWindow background color and check if your view is being removed for some reason.
[[[UIApplication sharedApplication] delegate] window].backgroundColor = [UIColor redColor]
I am not sure but you can try.
I had the same black screen problem using storyboard UINavigationController with two sequed UIViewcontrollers. My rootwiew controller would flash on screen followed by the black screen. After much researching of the problem I found a hint which stated that your code must be in the correct order when the app launches.
My original code under FinishedLaunching method:-
UIStoryboard storyBoard = UIStoryboard.FromName("MainStoryboard", NSBundle.MainBundle);
var navController = storyboard.InstantiateViewController(navigationController);
window.RootViewController = navController;
window.MakeKeyAndVisible();
This provided my root view controller followed by the black screen.
Simply moving window.MakeKeyAndVisible(); from FinishedLaunching method into the OnActivated method gives me a working app with page navigation back and forth with no errors and no black screen.
Related
I'm in the process of upgrading a 10 years old iOS application (Objective-C) for iOS 13 (Xcode 11.4) and noticed the following strange issue: When the app is launched while the iPhone (Simulator, 13.4) is in landscape orientation, the app's window has the correct dimensions, but is strangely rotated 90 degrees to the right. This does not happen on iPad (Simulator, 13.4) or iPhone Simulator 12.x where the app launches correctly.
Attached is a screenshot to better illustrate the issue.
The app is using XIBs and programmatically created views, no storyboards.
The initial view is created in application didFinishLaunchingWithOptions in the usual way:
[self.window addSubview:tabBarController.view];
self.window.rootViewController = tabBarController;
[self.window makeKeyAndVisible];
The tabBarController is loaded from a XIB.
The Launch Screen (which is the only storyboard in the app) is shown correctly.
Any ideas?
Turns out that removing the line
[self.window addSubview:tabBarController.view];
in application didFinishLaunchingWithOptions did the trick. Apparently this line was needed once, but causes havoc now.
Removing the line also fixed the Unbalanced calls to begin/end appearance transitions for <UITabBarController: ...> message I was seeing in the log output.
See also this answer in the Apple Developer Forums which brought me on the right track.
When I run my app on the iOS simulator on Xcode, I get a black background on my initial view controller, but it still shows the the textfields and buttons. All the other functions work as well. I looked for other solutions and the solutions I found only apply to a complete black screen. I tried resetting the simulator, checked the Deployment Info, and the whatever solution I came across, but it did not fix the problem.
This is what happens when I run the app:
If there is a ways to fix this problem, the help would be appreciated.
This might be Bug set color programmatically by
self.view.backgroundColor=[UIColor lightGrayColor];
Check backgroundcolor property of Main View and set it as per your need.
i have a problem. when i launch my app there is a black screen viewed for a seconds then the launch screen appeared.
my splash screen isn’t the default one. i used view controller because my splash had an animation.
i searched for a solution, and i get this on:
Black screen before my splash screen loads iphone
but it didn’t worked
any help please?
thanks
Have you selected your Launch Screen in your target's App Icons and Launch Images ?
Edit: If you don't use any launch (splash) screen or image then, a black screen is the default behaviour before loading your view controller.
I faced same issue but my solution is different,
I've made an extension of UINavigationController to make UINavigationBar clear.
So,the problem is , I was doing some R&D on that code and unknowingly put a method
open override func loadView() {
super.loadView()
}
and from that time, I started facing this issue.
My advice, please double check that you haven't don't something like that.
I had a custom splash screen to launch. But the Launch Screen file was pointed to Default LaunchScreen.storyboard. Replaced that with my original custom splash, the issue fixed
I installed the iOS8 beta, and now it seems that between my splashscreen and the presentation of my rootviewcontroller there is a gap of a couple of secs. in which the whole screen in black.
I read somewhere that it could be just that I'm assigning my viewController to the rootViewController too late, but I changed that and now assign it in the init method. I;m out of ideas and any help would be great.
I've been working on an iOS application and I came a cross with a bizarre behaviour.
This happens in iPhone 4 and 4S (I've not been able to test in iPhone 5 or 5S) but doesn't happen in the emulator or others apps in the same device. The interface is native (it's not a webapp).
Have anyone came across with this black spot?
EDIT: It happens in every TextField (secure or not)
I had the same issue, and just solved it for myself.
In my app, I'm presenting different modes of my app in different UIWindows, which involves creating different windows and changing which window is key and visible.
The text fields with the black eyeglass showing up were in a certain window, whose windowLevel = UIWindowLevelNormal.
Changing my keyWindow's windowLevel did the trick for me:
keyWindow.windowLevel = UIWindowLevelNormal + 0.1;
Voila somehow it's working... I hope this helps!