构建成功但黑屏

时间:2012-12-31 06:43:25

标签: iphone xcode

构建过程很好但是我得到一个黑屏。我尝试在app委托中添加一个断点,但它似乎没有运行。

它可能是什么?

这是我的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;
}

4 个答案:

答案 0 :(得分:0)

有时候(非常罕见)XCode可能会有不同的行为。如果有什么事情真的很奇怪,我会做以下事情。

  1. 做一个干净的构建
  2. 在模拟器中删除您的应用并重新构建
  3. 重新启动模拟器并重新构建
  4. 关闭XCode并重新打开
  5. 最糟糕的情况是重启系统

答案 1 :(得分:0)

无需重启任何内容。只需遵循以下步骤即可;你会实现你想要的。

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

享受编程!

答案 2 :(得分:0)

我认为您可能已将xib名称从ViewController更改为LoadingPage

如果是这样,那么您必须从.xib委派它。从右上角。喜欢,

enter image description here

我刚才认为这可能是你的解决方案。如果你已经成功了另一个,请告诉我.....:)

答案 3 :(得分:0)

确定!这已经解决了。

显然,与我合作的人改变了一个简单的词,并且搞砸了所有事情......

他从appDelegate继承了UIApplication,而不是UIResponder

现在可行。