2012-12-31 51 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继承。

现在,它的工作。

相关问题