У меня есть файл с именем MMAppDelegate.m:
#import "MMAppDelegate.h"
@implementation MMAppDelegate
@synthesize window;
@synthesize viewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
viewController = [[MainViewController alloc] init];
[window addSubview:viewController.view];
// Override point for customization after application launch.
[window makeKeyAndVisible];
return YES;
}
//and more standard methods
MMAppDelegate.h:
#import <UIKit/UIKit.h>
#import "MainViewController.h"
@interface MMAppDelegate : UIResponder <UIApplicationDelegate> {
UIWindow *window;
MainViewController *viewController;
}
@property (nonatomic, retain) UIWindow *window;
@property (nonatomic, retain) MainViewController *viewController;
@end
MainViewController.m:
#import "MainViewController.h"
@implementation MainViewController
- (void)viewDidLoad {
NSLog(@"view did load main view controller");
[super viewDidLoad];
self.view.backgroundColor = [UIColor redColor];
}
@end
И все же, когдаЯ запускаю программу, получаю черный экран и вывод:
2012-02-12 15:44:48.160 MoreMost[44076:f803] view did load main view controller
2012-02-12 15:44:48.163 MoreMost[44076:f803] Applications are expected to have a root view controller at the end of application launch
В чем проблема?