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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:24:06+00:00 2026-05-23T13:24:06+00:00

Note: Typically in a dealloc method you should release object instance variables directly (rather

  • 0

Note: Typically in a dealloc method you should release object instance variables directly (rather than invoking a set accessor and passing nilas the parameter), as illustrated in this example:

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

If you are using the modern runtime and synthesizing the instance variable, however, you cannot access the instance variable directly, so you must invoke the accessor method:

- (void)dealloc {
    [self setProperty:nil];
    [super dealloc];
}

What is modern runtime in iOS application development exactly?

  • 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-23T13:24:06+00:00Added an answer on May 23, 2026 at 1:24 pm

    It is possible to access the ivar directly, under the same name as the synthesized property. The @synthesize directive creates the ivar on your behalf if one does not already exist, and since that is a compiler directive, the ivar is available at compile-time. See “Runtime Difference” in the Declared Properties chapter of The Objective-C Programming Language. As Abizern noted in a comment, it’s also possible to specify whatever name you like for the ivar: @synthesize coffee=tea; — here, tea is the ivar and coffee the property.

    To use the ivar, simply refer to it like any other variable, without using the dot syntax. The following is all perfectly legal and works as expected:

    @interface Grisby : NSObject {}
    @property (retain) NSObject * obj;
    @end
    
    @implementation Grisby
    
    @synthesize obj;
    
    - (void) dealloc {
        [obj release], obj = nil;
        [super dealloc];
    }
    
    - (id) init {
        self = [super init];
        if( !self ) return nil;
    
        obj = [NSObject new];
    
        return self;
    }
    
    - (NSObject *) obj {
        return [[obj retain] autorelease];
    }
    
    @end
    

    The “modern runtime” was introduced with Mac OS X 10.5 (Leopard) as part of the transition to 64-bit. All versions of iOS use the modern runtime. Synthesized instance variables are a feature of the modern runtime, as noted in the link I provided above.

    The other key difference, noted in “Runtime Versions and Platforms” of the Objective-C Runtime Programming Guide, is that instance variables are “non-fragile”. There is a layer of indirection added to ivar storage and access which allows classes to add variables without affecting the storage of derived classes. It also presumably facilitates instance variable synthesis. Greg Parker has an explanation involving kittens, there’s passing reference to it in Mike Ash’s 2009 runtime writeup, and Bavarious here on SO has a swell post about ivar storage and class extensions.

    You can see other things that changed, though without explanation, in the “Mac OS X Version 10.5 Delta” chapter of the Objective-C Runtime Reference.

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

Sidebar

Related Questions

NOTE: I am not set on using VI, it is just the first thing
Note that I am not asking which to choose (MVC or MVP), but rather
I've read that (all things equal) PHP is typically faster than MySQL at arithmetic
Please note that this question is about CGLayer (which you typically use to draw
NOTE: XMLIgnore is NOT the answer! OK, so following on from my question on
Note: This was posted when I was starting out C#. With 2014 knowledge, I
Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost
Note : The code in this question is part of deSleeper if you want
Note The question below was asked in 2008 about some code from 2003. As
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column

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.