Objective-C
By Apple
Objective-C is an object-oriented programming language that extends C with Smalltalk-style messaging, historically the primary language for building macOS and iOS applications before Swift's introduction.
Definition
Objective-C is an object-oriented programming language that extends C with Smalltalk-style messaging, historically the primary language for building macOS and iOS applications before Swift's introduction.
Overview
Objective-C was created in the early 1980s by combining C with object-oriented, message-passing concepts borrowed from Smalltalk. Apple adopted it as the primary language for NeXTSTEP and, later, macOS and iOS development, making it the dominant language for Apple platform development for roughly three decades. Its distinctive syntax uses square-bracket message sends (e.g., `[object doSomething]`) rather than the dot-notation method calls common in most C-derived languages, which gives Objective-C code a visually distinct style. Because it is a strict superset of C, Objective-C code can call C functions and libraries directly, and it introduced dynamic runtime features — such as message forwarding and method swizzling — that gave Apple's frameworks (like Cocoa and Cocoa Touch) considerable flexibility. In 2014, Apple introduced Swift as a modern replacement designed to be safer and more approachable than Objective-C, and Swift has since become the default language for new Apple platform development. Objective-C remains in active use for maintaining older iOS and macOS codebases and in projects that interoperate closely with existing Objective-C frameworks, but it is rarely chosen for greenfield development today.
Key Features
- Strict superset of C with Smalltalk-inspired object messaging
- Distinctive square-bracket message-send syntax
- Direct interoperability with C and C++ code and libraries
- Dynamic runtime supporting message forwarding and reflection
- Historic primary language for macOS and iOS development
- Fully interoperable with Swift in mixed-language projects