2012-12-31 94 views
-1

構建過程很好,但然後我得到一個黑屏。我試着在應用程序委託中放置一個斷點,但似乎並未運行。構建成功,但黑屏

它可能是什麼?

這是我的didFinishLaunchingWithOptions方法:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    //Init Airship launch options 
    NSMutableDictionary *takeOffOptions = [[[NSMutableDictionary alloc] init] autorelease]; 
    [takeOffOptions setValue:launchOptions forKey:UAirshipTakeOffOptionsLaunchOptionsKey]; 

    // Create Airship singleton that's used to talk to Urban Airship servers. 
    // Please populate AirshipConfig.plist with your info from http://go.urbanairship.com 
    [UAirship takeOff:takeOffOptions]; 
    // Register for notifications 
    [[UAPush shared] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |        UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; 

    [[UIApplication sharedApplication] registerForRemoteNotificationTypes: 
    (UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)]; 

    usersData = [PlayersData sharedInstance]; 
    //[usersData cleanUserDefauts]; // --- use to clean user defaults 

    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; 
    // Override point for customization after application launch. 

    self.loadingPageVC = [[LoadingPage alloc] initWithNibName:@"LoadingPage" bundle:nil]; 
    self.window.rootViewController = self.loadingPageVC; 

    [self.window makeKeyAndVisible]; 



    ConnectionManager *connectionManager = [ConnectionManager sharedInstance]; 
    NSLog(@"Connection statement: %@",[connectionManager checkConnection]); 
    if ([[connectionManager checkConnection] isEqualToString:@"connected with wifi"] || [[connectionManager checkConnection] isEqualToString:@"connected with wwan"]) { 
    [connectionManager getLocation]; 
    } 
    return YES; 
} 
+1

你需要重新啓動xcode –

+2

你可以顯示你的'AppDelegate'的'didFinishLaunchingWithOptions'方法嗎?這可能是一個錯誤。 – Krunal

+0

重新啓動你的模擬器 –

回答

0

有時(很少)的XCode可以表現different.If東西是很奇怪的,我會做以下事情。

  1. 做一個乾淨的構建
  2. 在模擬器中刪除您的應用程序,並重新建造
  3. 重新啓動模擬器,並重新建造
  4. 關閉Xcode和重新打開它
  5. 最壞的情況,就是重新啓動系統
0

不需要重新發送任何東西。只要按照下面給出的步驟&,你將實現你想要的。

1. Go to /Users/<MAC_NAME>/Library/Application Support/iPhone Simulator/<SIMULATOR_VERSION>, delete all & run app 

享受編程!

+0

我試過了,但是當我點擊播放時它會立即停止 –

+0

你想創建.app還是.ipa? –

+0

現在,我只想測試我的應用程序。現在不需要IPA。 –

0

我想你可能已經把你的xib名字從ViewController更改爲LoadingPage

如果是這樣,那麼你必須從你的.xib中委託它。從右上角開始。像,

enter image description here

我剛纔給我的意見,這可能是您的解決方案。如果你已經成功與另一個,讓我知道..... :)

+0

這是我的項目的一個老部分,現在工作了幾個月:)這不是問題 –

+0

好吧,我找不到其他任何東西。歡迎任何幫助.... :) – Krunal

0

好吧!這解決了。

顯然有人跟我改一個簡單的單詞和搞砸了一切工作...

他從UIApplication而不是從UIResponder作出appDelegate繼承。

現在,它的工作。

相關問題