Objective-C Runtime Objective-Cランタイム

Describes the macOS Objective-C runtime library support functions and data structures. 関数とデータ構造体をサポートするmacOS Objective-C ランタイムライブラリを記述します。

Overview 概要

The Objective-C runtime is a runtime library that provides support for the dynamic properties of the Objective-C language, and as such is linked to by all Objective-C apps. Objective-C runtime library support functions are implemented in the shared library found at /usr/lib/libobjc.A.dylib.

You typically don't need to use the Objective-C runtime library directly when programming in Objective-C. This API is useful primarily for developing bridge layers between Objective-C and other languages, or for low-level debugging.

The macOS implementation of the Objective-C runtime library is unique to the Mac. For other platforms, the GNU Compiler Collection provides a different implementation with a similar API. This document covers only the macOS implementation.

The low-level Objective-C runtime API is significantly updated in OS X version 10.5. Many functions and all existing data structures are replaced with new functions. The old functions and structures are deprecated in 32-bit and absent in 64-bit mode. The API constrains several values to 32-bit ints even in 64-bit mode—class count, protocol count, methods per class, ivars per class, arguments per method, sizeof(all arguments) per method, and class version number. In addition, the new Objective-C ABI (not described here) further constrains sizeof(anInstance) to 32 bits, and three other values to 24 bits—methods per class, ivars per class, and sizeof(a single ivar). Finally, the obsolete NXHashTable and NXMapTable are limited to 4 billion items.

“Deprecated” below means “deprecated in OS X version 10.5 for 32-bit code, and disallowed for 64-bit code.”

Who Should Read This Document

The document is intended for readers who might be interested in learning about the Objective-C runtime.

Because this isn’t a document about C, it assumes some prior acquaintance with that language. However, it doesn’t have to be an extensive acquaintance.

Topics 話題

Working with Classes クラスを扱う

Adding Classes クラスを加える

Working with Instances インスタンスを扱う

Obtaining Class Definitions

Working with Instance Variables

Associative References 関連参照

Working with Methods メソッドを扱う

Working with Libraries ライブラリを扱う

Working with Selectors セレクタを扱う

Working with Protocols プロトコルを扱う

Using Objective-C Language Features Objective-C言語機能を使う

Class-Definition Data Structures

Instance Data Types

These are the data types that represent objects, classes, and superclasses.

Constants 定数

See Also 参照

Related Documentation 関連文書