Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3596832
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:02:23+00:00 2026-05-18T20:02:23+00:00

I have the following delegate files. My AboutViewController in MainWindow.xib loads the AboutViewController.xib and

  • 0

I have the following delegate files. My AboutViewController in MainWindow.xib loads the AboutViewController.xib and the aboutViewController outlet is connected to it. Also, navController is loaded from another ViewController.xib.
AboutViewController’s view is displayed at start up and removed after one second, so i release its view controller by setting the ivar to nil.

As the about view controller is loaded by XCode automatically, am i doing something wrong(leaking memory etc.) by setting it to nil manually myself? why or why not?

Thanks

– MyProjAppDelegate.h

#import <UIKit/UIKit.h>
@interface MyProjAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
    UIViewController *aboutViewController;
    UINavigationController *navController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UIViewController *aboutViewController;
@property (nonatomic, retain) IBOutlet UINavigationController *navController;
@end

– MyProjAppDelegate.m

#import "MyProjAppDelegate.h"
#import "AboutViewController.h"

@implementation MyProjAppDelegate
@synthesize window;
@synthesize aboutViewController;
@synthesize navController;

- (void)applicationDidFinishLaunching:(UIApplication *)application {    

    [window addSubview:aboutViewController.view];
    [window makeKeyAndVisible];

    [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(showMainView) userInfo:nil repeats:NO];
}

-(void)showMainView {
    [aboutViewController.view removeFromSuperview];
    self.aboutViewController = nil;

    [window addSubview:navController.view];
}

- (void)dealloc {
    [navController release];
    [aboutViewController release];
    [window release];
    [super dealloc];
}
@end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:02:24+00:00Added an answer on May 18, 2026 at 8:02 pm

    As the about view controller is loaded by XCode automatically, am i doing something wrong(leaking memory etc.) by setting it to nil manually myself?

    No, you’re not doing anything wrong, because you are using the property accessor method (self.aboutViewController) to set it to nil; the accessor will take care of the release. (And, you are correctly removing it from the superview before releasing it 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following delegate files. My AboutViewController in MainWindow.xib loads the AboutViewController.xib and
Eg. I have following delegate method I want to use as a callback function
I have the following code (calling a method returning IEnumerable): FibonacciWithLinq.Skip(delegate() { return 5;
I have the following code in a full .NET framework solution: public delegate int
I have following code - methods to read XML files. But it works very
I have a simple application with the following code: FileInfo[] files = (new DirectoryInfo(initialDirectory)).GetFiles();
I get an annoyingly vague error from the following code: GFree2AppDelegate *delegate = [[UIApplication
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have following string String str = replace :) :) with some other string;
I have following foreach-loop: using System.IO; //... if (Directory.Exists(path)) { foreach(string strFile in Directory.GetFiles(path,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.