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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:51:09+00:00 2026-06-06T23:51:09+00:00

Looking inside the runtime.h, I found the definition of the structure objc_class. Among various

  • 0

Looking inside the runtime.h, I found the definition of the structure objc_class.

Among various members, We have this :-

struct objc_method_list **methodLists

We definitely need to know what all methods a class has,
But a list of methods should be fine, but why do we have “lists” ?

Why not just one list ?

Also, can anyone specify that, Are methods inherited from superclass part of that list or we get to them via superclass pointer that points to parent class’s structure.

  • 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-06T23:51:11+00:00Added an answer on June 6, 2026 at 11:51 pm

    The purpose is explained in objc-class.m, as linked by Georg:

    cls->methodLists may be in one of three forms:

    1. NULL: The class has no methods.
    2. non-NULL, with CLS_NO_METHOD_ARRAY set: cls->methodLists points
      to a single method list, which is the class’s only method list.
    3. non-NULL, with CLS_NO_METHOD_ARRAY clear: cls->methodLists points to
      an array of method list pointers. The end of the array’s block
      is set to -1. If the actual number of method lists is smaller
      than that, the rest of the array is NULL.

    Attaching categories and adding and removing classes may change
    the form of the class list. In addition, individual method lists
    may be reallocated when fixed up.

    Classes are initially read as #1 or #2. If a category is attached
    or other methods added, the class is changed to #3. Once in form #3,
    the class is never downgraded to #1 or #2, even if methods are removed.
    Classes added with objc_addClass are initially either #1 or #3.

    The short answer is therefore “because of categories.” When a category is injected, rather than try to combine its method list with the one existing list, a new entry is simply added to methodLists, and set to the list coming from the category. This probably makes category injection faster, since it avoids (potential) large reallocations and copying.

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

Sidebar

Related Questions

I'm looking for an elegant pattern to solve this problem: I have several user
I have a C# program that executes a thread. Inside this thread, I have
Looking at the following code, does theme[sprite].img get nested inside result[definition].data (as theme[sprite].img is
I am looking inside the code of an air quality model written in fortran,
Looking at options for embedding the 3D Secure page inside my own order form,
I am looking to do a for loop inside of Less. Is it possible
I'm looking for a smallish OSGi container to install inside of what will become
I am looking for an algorithm to generate equally distributed points inside a polygon.
I am looking for a way to store references to variables inside a NSMutableArray.
I'm looking for a way to open an Access MDB file inside a Java

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.