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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:14:06+00:00 2026-05-19T01:14:06+00:00

Possible Duplicates: Why shouldn't I use Objective C 2.0 accessors in init/dealloc? dealloc, use

  • 0

Possible Duplicates:
Why shouldn't I use Objective C 2.0 accessors in init/dealloc?
dealloc, use release or set to nil for properties?

Hi,

Apple usually release ivars in dealloc but is there anything wrong with nilling the properties in dealloc?

I mean instead of this:

- (void) dealoc(){
   [myRetainedProperty release];
   [super dealloc];
}

write code like this:

- (void) dealoc(){
   self.myRetainedProperty = nil;
   [super dealloc];
} 

I know that it is one additional method call but on the other hand it is safer as it doesn’t crashes when you change your property form retain to assign and forget to amend dealloc.

What do you think? Can you think about any other reason to use release instead of setting to nil besides performance?

UPDATE:
It appeared that this question was a duplicate of “Why shouldn’t I use Objective C 2.0 accessors in init/dealloc?”.

  • 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-19T01:14:07+00:00Added an answer on May 19, 2026 at 1:14 am

    Something quite similar has already been discussed: Why shouldn't I use Objective C 2.0 accessors in init/dealloc?

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

Sidebar

Related Questions

Possible Duplicates: Should I use public properties and private fields or public fields for
Possible Duplicates: Why should I prefer to use member initialization list? C++ - what
Possible Duplicates: In C#, should I use string.Empty or String.Empty or “” ? What
Possible Duplicates: While vs. Do While When should I use do-while instead of while
Possible Duplicates: How effective is obfuscation? Protect ASP.NET Source code (Why) should I use
Possible Duplicates: Why is it bad to use goto? GOTO still considered harmful? I
Possible Duplicate: Objective-C properties: atomic vs nonatomic By default all properties in Objective-C are
Possible Duplicates: When should I use # and = in ASP.NET controls? What is
Possible Duplicates: Static linking vs dynamic linking C++ application - should I use static
Possible Duplicates: Is it OK to use "delete this" to delete the current object?

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.