Oops, I was wrong! Xcode 4.2 is the latest version for Snow Leopard. OP should upgrade to that at least.
4.2 for Snow Leopard is only available to paid developers. It's not a free download. Just sayin'.
Oops, I was wrong! Xcode 4.2 is the latest version for Snow Leopard. OP should upgrade to that at least.
4.2 for Snow Leopard is only available to paid developers. It's not a free download. Just sayin'.
@implementation AppDelegate
@synthesize window, navigationController;
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
// low on memory: do whatever you can to reduce your memory foot print here
}
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
// To set the status bar as black, use the following:
// application.statusBarStyle = UIStatusBarStyleBlackOpaque;
// this helps in debugging, so that you know "exactly" where your views are placed;
// if you see "red", you are looking at the bare window, otherwise use black
// window.backgroundColor = [UIColor redColor];
// add the navigation controller's view to the window
[window addSubview: navigationController.view];
[window makeKeyAndVisible];
}
- (void)dealloc
{
[navigationController release];
[window release];
[super dealloc];
}
@end
How is the viewController 'added' to the appDelegate?
[window addSubview: navigationController.view];
The navigationController has a view property. This does not mean the navigationController is a view. Similarly, the AppDelegate object has a window instance variable. Again, this does not mean the AppDelegate is a window, nor does it mean the window is the AppDelegate.
A horse has a tail, but that doesn't mean the horse is a tail, nor is a tail a horse. A car has a steering wheel, but the steering wheel is not a car.