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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:48:57+00:00 2026-06-09T02:48:57+00:00

In the legacy version of Objective-C, an objc_class struct is implemented like this: struct

  • 0

In the legacy version of Objective-C, an objc_class struct is implemented like this:

struct objc_class {
    Class isa;
    Class super_class;
    const char *name;
    long version;
    long info;
    long instance_size;
    struct objc_ivar_list *ivars;
    struct objc_method_list **methodLists;
    struct objc_cache *cache;
    struct objc_protocol_list *protocols;
};

So, the struct that represents an object stores a pointer to the object’s class, a pointer to the the object’s super class, the object’s class name, the object’s version, info and instance size, the object’s instance variables list, the object’s methods list, the object’s cache and the object’s protocols list. The presence of these fields in the struct that represents an object is pretty understandable since each one of them stores an information about the object.

However, the Objective-C 2.0 implementation of the same struct objc_class is like this:

struct objc_class {
    Class isa;
};

So, in this version of objc_class, there is only one field in the struct: a pointer to the object’s class struct.

My question, then, is how are the other information about the object stored in Objective-C 2.0 since there is only one field in the struct that represents the objects?

  • 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-09T02:48:59+00:00Added an answer on June 9, 2026 at 2:48 am

    It’s all in the new (ok, well not so new anymore) non-fragile ABI.

    Basically, instead of storing iVars inside of a struct like you used to (which would break inheritance if a superclass changed it’s iVar layout), the compiler puts iVar redirection through another layer, similar to objc_setAssociatedObject at runtime.

    This allows for a few interesting scenarios. Consider the following:

    @interface A { // part of libA.a
       id var1;
       int var2;
       float var3;
    } 
    
    @end
    
    @interface B : A { // part of libB.a
       id var4;
    }
    
    @end
    

    Now, what if some time down the road, we need to change class A, and we determine we need more precision in var3 (converting it to a long double, for example)?

    In the older, fragile ABI, we would be screwed until the maker of libB updated. However, with this new, non-fragile ABI, we have the flexibilty to change all of this while libB still works.

    While in theory this may be slower by a few cycles, it adds easier ways to lookup iVars at runtime, more flexible subclassing, and support for different kinds of iVars (__weak, for example).

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

Sidebar

Related Questions

INFORMIX-SQL 2.10.06E (DOS 6.22): This is one of the legacy version of isql that
I'm dealing with a legacy database and I'd like to create a test version
We're porting a legacy Java app to JRuby and would like to reuse some
I've got legacy URLs like: mysite.com/index2.php?option=com_mtree&task=print&link_id=383&Itemid=168 and I'd like to redirect any URL that
I work with a legacy svn repo. However, I would like to enjoy the
I'm interested in learning Objective C for iPhone development. This is a topic which
I'm importing a legacy db to a new version of our program, and I'm
I have this legacy code which embeds an SWF into an HTML using an
There are two runtimes for Cocoa/Objective-C: the legacy runtime and the modern runtime (that's
I'm updating some legacy code from the old 3.0 version of the C# Facebook

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.