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.
The purpose is explained in objc-class.m, as linked by Georg:
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.