How does objc_msgSend work internally in Objective-C runtime?

Updated May 17, 2026

Short answer

objc_msgSend is the core runtime function that performs dynamic method dispatch using selectors and method lookup tables.

Deep explanation

When you call a method like [obj doSomething], the compiler converts it into objc_msgSend(obj, @selector(doSomething)). The runtime then performs fast path lookup in the class's cache. If not found, it searches method lists up the inheritance chain. If still not found, it triggers dynamic resolution or message forwarding. This system enables Objective-C's dynamic behavior but introduces overhead compared to static dispatch languages.

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More Objective-C interview questions

View all →