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 6659299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:01:04+00:00 2026-05-26T02:01:04+00:00

Should the Variables with the @property nonatomic and retain be released explicitly. @interface MyScreenViewController

  • 0

Should the Variables with the @property nonatomic and retain be released explicitly.

@interface MyScreenViewController : UIViewController <UIWebViewDelegate> {
    UIWebView* greetingView;
}

@property(nonatomic, retain) IBOutlet UIWebView* greetingView;

- (void)dealloc {
  [greetingView release];
}

Is release in delloc method Required ???

  • 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-26T02:01:05+00:00Added an answer on May 26, 2026 at 2:01 am

    Ofcourse. YES you should release your properties with retain,copy and don’t for assign. You set the property to Nil in viewDidUnload.

    - (void)viewDidUnload {
         [super viewDidUnload];
    
         self.greetingView = nil;
    }
    
    - (void)dealloc {
         [greetingView release],greetingView = nil;
    
         [super dealloc];
    }
    

    Refer memory management in UIViewController Class reference: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html

    Memory is a critical resource in iOS, and view controllers provide built-in support for reducing their memory footprint at critical times. The UIViewController class provides some automatic handling of low-memory conditions through its didReceiveMemoryWarning method, which releases unneeded memory. Prior to iOS 3.0, this method was the only way to release additional memory associated with your custom view controller class but in iOS 3.0 and later, the viewDidUnload method may be a more appropriate place for most needs.

    When a low-memory warning occurs, the UIViewController class purges its views if it knows it can reload or recreate them again later. If this happens, it also calls the viewDidUnload method to give your code a chance to relinquish ownership of any objects that are associated with your view hierarchy, including objects loaded with the nib file, objects created in your viewDidLoad method, and objects created lazily at runtime and added to the view hierarchy. Typically, if your view controller contains outlets (properties or raw variables that contain the IBOutlet keyword), you should use the viewDidUnload method to relinquish ownership of those outlets or any other view-related data that you no longer need.

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

Sidebar

Related Questions

Basically I have this scenario going on: //in interface header @property(nonatomic,retain)OtherClass *otherClass; //implementation -
i have this code in my .h: @property (nonatomic, retain) NSArray *arrayData; What is
what type should my property be to work properly with core data float variables.
Should I instantiate my worker variables inside or outside my for loop E.g. a)
Should you ever use protected member variables? What are the the advantages and what
CGI scripts should have access to a list of environment variables set by the
I heard that static methods should use only static variables in java. But, main
I am not sure when I should use anonymous types instead of local variables
In Java, static final variables are constants and the convention is that they should
I am converting some environment variables to property sheets for some C++ projects. This

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.