在高级项目上工作,我的应用程序最近在启动画面后开始只加载黑屏.我没有使用故事板.我一直在寻找这个问题的解决方案,但似乎无法适应我的项目的其他解决方案.我的[github](https://github.com/cleif/Hastings/tree/Fixed)在这里有最新版本.下面是我的AppDelegate.h和.m文件中的代码.
.H
#import <UIKit/UIKit.h>
#import "IIViewDeckController.h"
#import "MenuViewController.h"
#import "HomeViewController.h"
#import "AboutViewController.h"
#import "AthleticsViewController.h"
#import "BroncoBoardViewController.h"
#import "ContactsTableViewController.h"
#import "MapViewController.h"
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (retain, nonatomic) UIViewController *menuViewController;
@property (retain, nonatomic) UIViewController *rootViewController;
@end
Run Code Online (Sandbox Code Playgroud)
.M
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize menuViewController = _menuViewController;
- (IIViewDeckController*) initializeMainViewControllers {
UIViewController *menuViewController = [[MenuViewController alloc] init];
UIViewController *rootViewController = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil];
IIViewDeckController* deckController = [[IIViewDeckController alloc] initWithCenterViewController:[[UINavigationController alloc] initWithRootViewController:rootViewController]
leftViewController:menuViewController];
return deckController; …Run Code Online (Sandbox Code Playgroud)