I\'m having trouble running my basic iPhone application (while going through the Stanford iTunes CS193p lectures) in the iOS simulator.
I\'ve been searching for a wh
When i have carried my project on Xcode 11.1, i got that problem. That black screen problem may occur any presentation inter ViewControllers.
That answer helped me. Because modal presentation changed with iOS 13. If you don't get that problem before iOS 13, please try to add line below to your ViewController before its presentation;
viewController.modalPresentationStyle = .fullScreen
after your code may seem like below;
let vc = UIViewController()
vc.modalPresentationStyle = .fullScreen //or .overFullScreen for transparency
self.present(vc, animated: true, completion: nil)
I am a newbie to the iOS app development. I was practising to develop iOS apps from the very beginning and while running a very basic Hello World app, I also faced same issue that only a black blank screen appears after building and running the app in iOS simulator. Somehow while struggling to find out a solution to the problem I accidentally clicked Window-->Scale-->50% in iOS simulator and it did solve my problem. I could then see the Home page with my app and clicking on app icon I was able to run my app successfully. App versions: Xcode 5.1 iOS Simulator: 7.1 OSX: 10.9.3
To make sure it's a simulator issue, see if you can connect to the simulator with a brand new project without changing any code. Try the tab bar template.
If you think it's a simulator issue, press the iOS Simulator menu. Select "Reset Content and Settings...". Press "Reset."
I can't see your XIB and what @properties you have connected in Interface Builder, but it could also be that you're not loading your window, or that your window is not loading your view controller.
I've managed to find the fix for this. It was found courtesy of this blog post:
http://vandadnp.wordpress.com/2012/03/18/xcode-4-3-1-cannot-attach-to-ios-simulator/
The solution is to press cmd+shift+, (command, shift and then comma ",").. that loads some options for release or debugging.
Change the debugger from LLDB to GDB. This fixes the issue.
Another Solution is that if you are building UI programatically in Objective C project, then you might need to add some code to inflate the view, so you will need to add those 3 lines to make the window's interface interacts with the code (the outer 2 are actually interacting with the code and the other one will change the screen to white so you will know it works).
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
...
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
Please check for all the constraints for all the views and review complete storyboard. Usually this happens because of that.
Regards, Arora