构建过程很好但是我得到一个黑屏。我尝试在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;
}
答案 0 :(得分:0)
有时候(非常罕见)XCode可能会有不同的行为。如果有什么事情真的很奇怪,我会做以下事情。
答案 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委派它。从右上角。喜欢,
我刚才认为这可能是你的解决方案。如果你已经成功了另一个,请告诉我.....:)
答案 3 :(得分:0)
确定!这已经解决了。
显然,与我合作的人改变了一个简单的词,并且搞砸了所有事情......
他从appDelegate
继承了UIApplication
,而不是UIResponder
。
现在可行。