Where’s the path of Objective-C runtime

Hi systems programming guys. I’m exploring the macOS as a low-level itself, so when I use the otool(1) utility to inspect a tiny objc helloworld program, it told me that there is a shared library like /usr/lib/libobjc.A.dylib (not identical) but I didn’t find that in path /usr/lib/. Also the docs sucked (see below). I want to know more details about the objc runtime on macOS (beta 27.6 +) and be seeking for help here because there are few materials online and not even to say the sucked AI.

The prima motivation is the runtime itself and how it works. Of course I would love to read disassembled code and manpages or using utilities that Apple offered to understand those things . But I really don’t know where is the runtime if both docs and otool output lied.

The latest documentation about Objective-C Runtime is outdate and it said “Objective-C runtime library support functions are implemented in the shared library found at /usr/lib/libobjc.A.dylib.”

Answered by Etresoft in 902431022

Apple's system-provided dynamic libraries are all pre-cached in the operating system and don't exist on disk.

You can find the source code to the Objective-C runtime here: https://opensource.apple.com

However, the open source site is always a little behind. It only has 26.5 right now. I'm sure it will be at least a year before 27.6 shows up.

Generally-speaking, Objective-C itself is outdated. Any documentation you find will be ancient. If you did find something really interesting, it's possible that it won't be useful because Apple will have already re-implemented that part in Swift.

Accepted Answer

Apple's system-provided dynamic libraries are all pre-cached in the operating system and don't exist on disk.

You can find the source code to the Objective-C runtime here: https://opensource.apple.com

However, the open source site is always a little behind. It only has 26.5 right now. I'm sure it will be at least a year before 27.6 shows up.

Generally-speaking, Objective-C itself is outdated. Any documentation you find will be ancient. If you did find something really interesting, it's possible that it won't be useful because Apple will have already re-implemented that part in Swift.

Don't use the comment feature. It hides your replies.

Swift is open source too. See https://github.com/swiftlang/swift

There is certainly still lots of Objective-C, but even something like AppKit isn't 100% Objective-C anymore. If you poke around in the Xcode debugger, especially UI debugging, you'll see more and more SwiftUI being used, even for things that were once ancient Objective-C code.

Where’s the path of Objective-C runtime
 
 
Q