ios - 启动图像后 iPhone 屏幕变黑

标签 ios error-handling xcode4.5

所以一切都很顺利,我的应用程序几乎完成了,直到发生这种情况。除了尝试在 iOS 模拟器中运行它之外,没有进行任何更改。当我打算再次在我的 iPhone 上尝试它时,启动图像后屏幕变黑了!!而且我在 xcode 中没有任何错误。

我尝试清理我的项目,重置 iOS 模拟器(只是为了好玩),重新启动我的 Macbook,重新启动 iPhone,从主屏幕删除应用程序并重新安装。

在我的 iPhone 5 上为 iOS 6 构建。

AppDelegate.h

//
//  AppDelegate.h
//  
//
//  Created by Øyvind Larsen Runestad on 13.01.13.
//  Copyright (c) 2013 Øyvind Larsen Runestad. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate> {

IBOutlet UITabBarController *tabBarController;
}
@property (strong, nonatomic) UIWindow *window;

@property(nonatomic, readonly) UITabBarController *moreNavigationController;

@end

AppDelegate.m
//
//  AppDelegate.m
//  
//
//  Created by Øyvind Larsen Runestad on 13.01.13.
//  Copyright (c) 2013 Øyvind Larsen Runestad. All rights reserved.
//

#import "AppDelegate.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end

有人有解决这个问题的方法吗?

最好的祝福,
Øyvind Larsen Runestad。

编辑:解决了!

Okay, i sorted it out. The Main Storyboard in the project was set to blank. All I had to do was to change this to MainStoryboard.

Seems like my AppDelegate is okay after all @H2CO3 ;)

最佳答案

如果这个 真的是您的实际代码,那么问题如下:您没有在应用程序启动时创建 key 窗口。

关于ios - 启动图像后 iPhone 屏幕变黑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14405330/

相关文章:

error-handling - 在 Erlang 中标记错误有好处吗?

parsing - clojure源代码在宏中的位置

objective-c - 我可以设计一个与另一个应用程序交互的iOS应用程序吗?

ios - 在推送时制作一个透明的导航栏并在弹出时恢复它

r - Sexpr 中的错误处理

objective-c - 使用 execl 从应用程序内部编译文件

iphone - objective c 类方法返回值,分配给弱/强属性

iphone - 在 xcode 中更改应用程序/目标名称

ios - 如何向外部用户发布testflight beta版本?

ios - app在后台时是否可以获取陀螺仪数据更新