应用程序不会在iOS 6上开始使用testflight

时间:2012-10-24 12:51:43

标签: iphone ios ipad xcode4 testflight

我有一个应用程序,我想在iOS设备上测试它。该应用程序使用 NIB文件而不使用故事板。

目标框架设置为 - 5.1 设备 - 通用。

我创建了IPA文件并上传到TestFlightApp。

我已经在iPad上下载并安装了该应用程序。奇怪的是,当我点击图标时,黑屏显示,没有其他任何事情发生。

我已完成以下设置。

主界面 - SSDMainViewController 主要故事板 - 未设置,因为我在应用程序中没有任何故事板。

这不是IOS版本的问题,因为其他应用程序运行正常。

  

编辑:当我双击iPad按钮时,我看到了该应用程序   没有崩溃。它正在后台运行。

     

编辑2:有关该问题的更多信息。

我已经采用了基于视图的应用程序,并且所有NIB都没有故事板。它最初是一个针对IOS 5.1的iPhone应用程序,但后来我将项目中的值更改为 UNIVERSAL 。但我认为这没问题,因为当我在iPad上安装它时它什么也没有给我看。它还显示黑屏与iPhone框架,然后没有。该应用程序仍在线程中。

困扰我的是我在AppDelegate

中做到了这一点

我已经设置了

self.mainViewController = [[SSDMainViewController alloc] initwithnibname:@"SSDMainViewController" bundle:nil];

然后我设置了导航控制器,然后将视图推送到它。

我发现了更多信息

在控制台中说。

应用程序应在应用程序启动结束时设置其根视图。

  

MY APP DELEGATE

ftipValue = 0.25;

cardtype = @"American Express";
[cardtype retain];

[self CallFunctionForLogout];

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

// Create an instance of YourViewController

//SSDMainViewController *yourViewController = [[SSDMainViewController alloc] init];
self.mainViewController = [[[SSDMainViewController alloc] initWithNibName:@"SSDMainViewController" bundle:nil] autorelease];



// Create an instance of a UINavigationController

// its stack contains only yourViewController

UINavigationController *navController = [[UINavigationController alloc]

                                                  initWithRootViewController:self.mainViewController];

navController.navigationBarHidden = YES;

// Place navigation controller's view in the window hierarchy

[[self window] setRootViewController:navController];

[self.window makeKeyAndVisible];

return YES;

3 个答案:

答案 0 :(得分:4)

请使用2(2)xib文件,我们想要两个xib(笔尖)的通用应用程序

  • 一个用于iPhone - ViewController_iPhone
  • 第二个用于iPad - ViewController_iPad

将以下代码添加到AppDelegate.m文件中。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
        // Override point for customization after application launch.
       if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
       {
           self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
        } 
       else {
           self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
        }
        self.window.rootViewController = self.viewController;
        [self.window makeKeyAndVisible];
        return YES;
    }

我已经做到了这一点,对我来说工作正常,希望它对你也有帮助。

答案 1 :(得分:3)

该错误意味着您没有正确设置应用程序。

你说你已经将SSDMainController设置为主界面文件 - 这适用于iPhone和iPad吗?通用应用程序的摘要选项卡的该部分中有两组条目。

我希望为iPad指定一个不同的xib文件,因为将使用不同大小的视图和不同的布局。

你有没有设置iPad xib,所以应用程序无法设置一个带有根视图控制器的窗口,或者你没有设置一个有效的iPad xib,所以它根本没有加载,相同的结果。

如果您只想让应用程序在带有2x按钮的迷你iPhone窗口中运行,请将其保留为仅限iPhone的应用程序。

答案 2 :(得分:2)

如果您收到“应用程序应在应用程序启动结束时设置其根视图。”有很多可能性。显然,问题所在,因为你的黑屏没有任何内容......

查看这个问题:Application windows are expected to have a root view controller at the end of application launch warning Rob Mayoff很好地描述了应用程序初始化时应该发生的事情。

此外,与上述帖子相关联的是this post,其中还有35个答案,其中包含可能发生的各种情况。

除了浏览这些链接之外,您还需要发布额外的代码和/或描述你的笔尖是如何连接的,以便任何人帮助你 - 正如可以通过无数种方式来破坏初始化序列所证明的那样。