-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;
}
4

4 回答 4

0

好的!这解决了。

显然,与我一起工作的人改变了一个简单的词,这把一切都搞砸了……</p>

appDelegate继承了 fromUIApplication而不是 from UIResponder

现在它起作用了。

于 2012-12-31T09:11:53.810 回答
0

有时(很少)XCode 的行为会有所不同。如果真的很奇怪,我会做以下事情。

  1. 做一个干净的构建
  2. 在模拟器中删除您的应用并重新构建
  3. 重新启动模拟器并再次构建
  4. 关闭 XCode 并重新打开它
  5. 最坏的情况是重新启动系统
于 2012-12-31T06:47:39.887 回答
0

无需重新启动任何东西。只需按照下面给出的步骤,您将实现您想要的。

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

享受编程!

于 2012-12-31T06:53:48.493 回答
0

我认为您可能已将您的 xib 名称从 更改 ViewControllerLoadingPage

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

在此处输入图像描述

我刚刚给出了我的意见,这可能是您的解决方案。如果你成功了另一个,请告诉我.....:)

于 2012-12-31T07:01:47.380 回答