I'm adding a view controller's view to my window in application:didFinishLaunchingWithOptions:
but the view does not become visible. I'm not sure what's wrong.
Here's my app delegate code:
@class ToolBar;
@class MainViewController;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
{
UIWindow *Window;
//UIToolbar *toolbar;
}
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) MainViewController *mainViewController;
@property (strong, nonatomic) ToolBar *toolbar;
@end
#import "AppDelegate.h"
#import "MainViewController.h"
#import "ToolBar.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize mainViewController = _mainViewController;
@synthesize toolbar =toolbar;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]autorelease];
self.mainViewController = [[[MainViewController alloc]init]autorelease];
[self.window addSubview:self.mainViewController.view];
//[self.window makeKeyAndVisible];
self.toolbar = [[[ToolBar alloc]init]autorelease];
[self.window addSubview:toolbar.view];
[self.window makeKeyAndVisible];
return YES;
}