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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:39:56+00:00 2026-06-05T02:39:56+00:00

Note: This other question seems relevant but it’s not: When does an associated object

  • 0

Note: This other question seems relevant but it’s not: When does an associated object get released?

I’m adding a second description to a UIView instance as follows:

- (void) setSecondDescription:(UIView*)view description2:(NSString*)description2 {
    objc_setAssociatedObject (view,&key,description2,OBJC_ASSOCIATION_RETAIN);
}

- (NSString*) secondDescription:(UIView*)view {
    return (id)objc_getAssociatedObject(view, &key);   
}

If the UIView deallocs, will the associated description 2 get dealloced? Is there any way to get this to happen automatically?

  • 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-06-05T02:39:57+00:00Added an answer on June 5, 2026 at 2:39 am

    If you want to actually see the description of the entire dealloc timeline, look at WWDC 2011, Session 322, 36:22. However, here’s the basic rundown (I wanted to remember it, so this is an actual comment in a piece of my code).

    Note, that the associated objects are released at the end of the life cycle.

    // General Information
    // We take advantage of the documented Deallocation Timeline (WWDC 2011, Session 322, 36:22).
    // 1. -release to zero
    //     * Object is now deallocating and will die.
    //     * New __weak references are not allowed, and will get nil.
    //     * [self dealloc] is called
    // 2. Subclass -dealloc
    //     * bottom-most subclass -dealloc is called
    //     * Non-ARC code manually releases iVars
    //     * Walk the super-class chain calling -dealloc
    // 3. NSObject -dealloc
    //     * Simply calls the ObjC runtime object_dispose()
    // 4. object_dispose()
    //     * Call destructors for C++ iVars
    //     * Call -release for ARC iVars
    //     * Erase associated references
    //     * Erase __weak references
    //     * Call free()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note: this question is related to this one , but two years is a
NOTE: This is not the same question as Python: Persistent shell variables in subprocess
I’m using Drupal (please note that this is not a Drupal related question), and
This seems similar to a number of other questions posted, but is actually a
Note: This is closely related to my other topic here and here , but
NOTE: the original question is moot but scan to the bottom for something relevant.
Please note, this question is regarding the shipping cost, not price. There is an
Note this question was originally posted in 2009, before C++11 was ratified and before
Note: This question has broadened in scope from previous revisions. I have tried to
Note: this is not real information: $ ssh-keygen -t rsa -C "tekkub@gmail.com" Generating public/private

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.