iOS: Use qFatal when detecting QApplication before UIApplicationMain

Gives a stack-trace at the point the error was caused, making it easier
to debug what's going on.

Change-Id: I0d65bb5061e9a97c142d41f6c99a1a1803cbe82d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
Tor Arne Vestbø 2015-03-04 12:43:03 +01:00 committed by Tor Arne Vestbø
parent b0182069e5
commit ddf09adeeb

View File

@ -69,12 +69,10 @@ QIOSIntegration::QIOSIntegration()
, m_accessibility(0)
{
if (![UIApplication sharedApplication]) {
qWarning()
<< "Error: You are creating QApplication before calling UIApplicationMain.\n"
<< "If you are writing a native iOS application, and only want to use Qt for\n"
<< "parts of the application, a good place to create QApplication is from within\n"
<< "'applicationDidFinishLaunching' inside your UIApplication delegate.\n";
exit(-1);
qFatal("Error: You are creating QApplication before calling UIApplicationMain.\n" \
"If you are writing a native iOS application, and only want to use Qt for\n" \
"parts of the application, a good place to create QApplication is from within\n" \
"'applicationDidFinishLaunching' inside your UIApplication delegate.\n");
}
// Set current directory to app bundle folder