运行我的iPad App时出现黑屏 [英] Blank black screen when running my iPad App

查看:471
本文介绍了运行我的iPad App时出现黑屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iPad应用程序遇到了一些障碍。我最近对我的代码做了一些不可恢复的更改,现在它只会启动黑屏。它会瞬间显示LoadingImage,然后直接显示为黑色。

I've run into a sort of roadblock with my iPad app. I apparently made some unrecoverable change to my code recently and now it will only launch with a black screen. It displays the LoadingImage for a split second and goes right to black.

为了简化我正在寻找的问题,我想要一些建议我应该从哪里开始寻找?到目前为止,我已经尽力检查并重新检查我能想到的所有内容,所以我已经准备好开始搜索一些指导。更具体地说,您的代码只会导致黑屏,而根本不运行任何代码的一些最常见的原因。它会是一个InterfaceBuilder问题,Xcode .h问题,我的方法的问题或什么?过去我有几次意外地解决了这个问题,但这次我很难找到消息来源。我在我的代码中添加了NSLog调用以帮助缩小问题范围(实际上在每个.m文件中)并且根本没有打印到日志中。

In an effort to streamline what sort of problem I'm looking for, I'd like some advice on where should I start looking? I've done my best so far to check and recheck everything I can think of already, so I'm ready to start the search over with some guidance. More specifically, what are some of the most common reasons that your code will just result in a black screen, without running any code at all. Would it be an InterfaceBuilder issue, an Xcode .h issue, a .m issue with my methods or what? I've sort of accidentally solved the issue a few times in the past, but am struggling to find the source this time. I've added NSLog calls throughout my code to help narrow down the problem (in every .m file actually) and none of them print to the log at all.

事实:


  • 我正在使用最新的Xcode和iOS
    SDK(适用于iPad,3.2) 。

  • 它在模拟器和我的实际iPad中都有。

  • 我的iPad不是,而且还没有
    Jailbroken。

  • 我的应用实际上非常简单,它只是一个带有详细视图的分割视图和一个自定义根视图,其中包含一个调整大小的表。

  • I'm using the latest Xcode and iOS SDK (for iPad, 3.2).
  • It does it in both the simulator and my actual iPad.
  • My iPad is not, and hasn't ever been Jailbroken.
  • My app is actually really simple, it's just a single split-view with a detail view and a custom root view which has a resized table in it.

任何人都能提供的任何帮助都会让我失去很多抱怨,呻吟和哭泣。嘿

Any help anyone can provide would really save me a lot of whining, mopeyness and crying. heh

谢谢。

其他请求代码:

来自MasterView.m的viewDidLoad

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"Master: This self: %@", self);

    self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0);
    self.arrMenuOptions = [[NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"MainMenuOptions" ofType:@"plist"]] retain];
}

来自DetailView.m的viewDidLoad

- (void)viewDidLoad {
    /// Initialize the preset things.
    NSLog(@"Detail: This self: %@", self);
    eleDetailToolbar.barStyle = UIBarStyleBlack;

    eleWebView.opaque = NO;
    eleWebView.backgroundColor = [UIColor clearColor];
    eleWebView.delegate = self;
    [super viewDidLoad];
}

AppDelegate摘录

@implementation AssistantAppDelegate

@synthesize window, splitViewController;//, detailViewController, masterViewController;
//rootViewController, eleMasterNavigationItem

#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    NSLog(@"AppDelegate: This self: %@", self);

    // Override point for customization after app launch    

    // Add the split view controller's view to the window and display.
    [window addSubview:splitViewController.view];
    [window makeKeyAndVisible];

    return YES;
}


推荐答案


  1. 您是否在运行控制台上收到任何错误消息?

  2. 您是否在界面构建器中连接了一个视图?或者尝试加载不存在的XIB文件?

  3. 您是否在<$中填充了主nib文件基本名称密钥? c $ c> info.plist 档案?

  4. 你的 applicationDidFinishLaunching viewDidLoad 方法中有什么?

  5. 您是否删除了Interface Builder中对某些内容的引用?

  6. 您是否添加了最近可能已损坏的新资源?

  1. Are you getting any error messages on the Run console?
  2. Do you have a view hooked up in interface builder? Or trying to load a non-existent XIB file?
  3. Do you have the main nib file base name key populated in the info.plist file?
  4. What is in your applicationDidFinishLaunching and viewDidLoad methods?
  5. Have you deleted any references to something in Interface Builder?
  6. Have you added any new resources recently that could be corrupted?

请尽可能使用代码更新您的问题

Please update your question if possible with code

更新基于评论:如果您没有 applicationDidFinishLaunching 方法,您如何添加窗口?

Update based on comments: How are you adding a window if you don't have an applicationDidFinishLaunching method?

你应该在App Delegate .m文件中有这样的东西:

You should have something like this in the App Delegate .m file:

@synthesize window;
@synthesize viewController;

- (void)applicationDidFinishLaunching:(UIApplication *)application {    

    // Override point for customization after app launch    
    [window addSubview:viewController.view];
    [window makeKeyAndVisible];

}

如果不在这里,则不添加任何窗口,你得到一个黑屏。

If this isn't here, no window gets added, and you get a black screen.

这篇关于运行我的iPad App时出现黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆