我是 Xcode 的新手,如果能帮助我消除这种内存泄漏,我将不胜感激。它显示在线:[window addSubview:navcontrol.view]; 下面是我的代码:
#import "ExSignupAppDelegate.h"
#import "SignupTableViewController.h"
@implementation ExSignupAppDelegate
@synthesize window;
@synthesize viewController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UINavigationController* navcontrol;
navcontrol = [[UINavigationController alloc]init];
SignupTableViewController* signupVC = [[SignupTableViewController alloc]initWithNibName:@"SignupTableViewController" bundle:nil];
signupVC.title = NSLocalizedString(@"Title Abstract Search", @"");
[navcontrol pushViewController:signupVC animated:NO];
[signupVC release];
[window addSubview:navcontrol.view];
return YES;
}
-(void)applicationDidFinishLaunching:(UIApplication *)application
{
[window addSubview:viewController.view];
[window makeKeyAndVisible];
}
- (void)dealloc
{
[window release];
[viewController release];
[super dealloc];
}
@end