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

  • Home
  • SEARCH
  • 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 1113145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:48:41+00:00 2026-05-17T02:48:41+00:00

To be specific, I’m talking about writing a dealloc like so: -(void)dealloc { self.myvar

  • 0

To be specific, I’m talking about writing a dealloc like so:

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

I understand this goes against Apple’s recommendations. I also understand that it can cause issued with KVO as well using the setter on a partially deallocated object. But if I’m making the calls in this order (ie: setters first, then the [super dealloc]) is there any risk in doing this? I’m trying to understand exactly what the dangers are, and specifically why this is a Bad Thing(tm). Thanks….

  • 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-17T02:48:42+00:00Added an answer on May 17, 2026 at 2:48 am

    in addition to the reasons stated (which can mean UB or disaster), you may end up with objects reconstructing themselves, and unnatural dependency cycles (e.g. among subclasses that override accessors) – the subclasses may have established their own dependencies, although the subclass’ ivars are (effectively) out of reach and should not be known to the superclass. it can severely restrict the usability of your objects for subclasses, and break their implementation (because their implementation may expect hacks, or may go through some form of resurrection). this is all stuff you want to avoid, and you should avoid accessors in init… for similar reasons. it gets ugly in large systems, and difficult to maintain – while the issue is easily avoided.

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

Sidebar

Related Questions

Suppose I have a specific table selected in TinyMCE, like this: var ed =
In specific case, like this f(x) { return x+5; } g(x, y) { return
Specific question What is a shell command to turn strings like this class A(B,
This specific questions stems from the attempt to handle large data sets produced by
I have a specific question about looping variable names in WPF. XAML code looks
This is a specific question. We are coding a wcf service with using C#,
This question is quite specific. I'm using Symfony2 White October Admin Bundle for generating
This question is specific to MonoDevelop I think. I've got a test monorail solution
This specific class's member private fields which are annotated @autowired are within a service
My specific question is about ASP.NET MVC but I am sure that the answers

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.