Reputation: 69757
This is from some sample code from a book
// On launch, create a basic window
- (void)applicationDidFinishLaunching:(UIApplication *)application {
UIWindow *window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:[[HelloController alloc] init]];
[window addSubview:nav.view];
[window makeKeyAndVisible];
}
But a release
is never called for window
nor for nav
.
alloc
was called, right?dealloc
? Perhaps I'm wrong all around...
Upvotes: 1
Views: 71
Reputation: 29009
Yes, normally.
However; UIWindow is normally not released, nor is the root navigation controller, as, well, what's the point. They last for the duration of your application.
Also, get a newer book; we use Interface Builder for this stuff now.
Upvotes: 4