Ich habe da viele Tutorials aus einem Buch "Spiele entwickeln, für Ipad ... etc von Hanser" aber allen Beispielen und jetzt auch bei allem was ich mir daraus im Verlauf gebastelt habe kommt die Fehlermeldung:
"Application windows are expected to have a root view controller at the end of application launch" im Program Output.
Ich habe keinen Schimmer was ich falsch gemacht habe, ist bei mir eine Xcode Einstellung falsch? Oder hat jeder die Fehlermeldung?
Und kann ich sie ignorieren? Auf iPad und iPhone läuft nämlich alles ohne Probleme, es ist nur eine Warnmeldung so wie es aussieht.
Das hier ist der relevante Code:
( eigentlich original aus dem Buchbeispiel, habe da nichts rumgepfuscht bis auf die mainView.backgroundColor
Alles anzeigen
"Application windows are expected to have a root view controller at the end of application launch" im Program Output.
Ich habe keinen Schimmer was ich falsch gemacht habe, ist bei mir eine Xcode Einstellung falsch? Oder hat jeder die Fehlermeldung?
Und kann ich sie ignorieren? Auf iPad und iPhone läuft nämlich alles ohne Probleme, es ist nur eine Warnmeldung so wie es aussieht.
Das hier ist der relevante Code:
( eigentlich original aus dem Buchbeispiel, habe da nichts rumgepfuscht bis auf die mainView.backgroundColor
Quellcode
- #import "MyGameAppDelegate.h"
- @implementation MyGameAppDelegate
- @synthesize window = _window;
- - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- mainView = [[MainView alloc] initWithFrame: [UIScreen mainScreen].applicationFrame];
- mainView.backgroundColor = [UIColor blackColor];
- [mainView setupOGL];
- [self.window addSubview: mainView];
- [self.window makeKeyAndVisible];
- return YES;
- }
- - (void) startGameLoop {
- NSString *deviceOS = [[UIDevice currentDevice] systemVersion];
- bool forceTimerVariant = TRUE;
- if (forceTimerVariant || [deviceOS compare: @"3.1" options: NSNumericSearch] == NSOrderedAscending) {
- //33 frames per second -> timestep between the frames = 1/33
- NSTimeInterval fpsDelta = 0.0303;
- timer = [NSTimer scheduledTimerWithTimeInterval: fpsDelta
- target: self
- selector: @selector( loop )
- userInfo: nil
- repeats: YES];
- } else {
- int frameLink = 2;
- timer = [NSClassFromString(@"CADisplayLink") displayLinkWithTarget: self selector: @selector( loop )];
- [timer setFrameInterval: frameLink];
- [timer addToRunLoop: [NSRunLoop currentRunLoop] forMode: NSDefaultRunLoopMode];
- }
- NSLog(@"Game Loop timer instance: %@", timer);
- }
- - (void) stopGameLoop {
- [timer invalidate];
- timer = nil;
- }
- - (void) loop {
- [mainView drawRect:[UIScreen mainScreen].applicationFrame];
- }
- - (void) applicationDidBecomeActive: (UIApplication *) application {
- [self startGameLoop];
- }
- - (void) applicationWillResignActive: (UIApplication *) application {
- [self stopGameLoop];
- }
- - (void)applicationDidEnterBackground:(UIApplication *)application {}
- - (void)applicationWillEnterForeground:(UIApplication *)application {}
- - (void)applicationWillTerminate:(UIApplication *)application {}
- - (void) dealloc {
- [self stopGameLoop];
- [timer release];
- [_window release];
- [mainView release];
- [super dealloc];
- }
- @end
Just a bloggingFreak raysspieleschmiede.blogspot.de freakwave-games.blogspot.de