What Is Objective-C?
Objective-C is a general-purpose, object-oriented programming language created by Brad Cox and Tom Love in the early 1980s by adding Smalltalk-style messaging to the C language. It became the primary language for NeXTSTEP and, after Apple acquired NeXT in 1996, for macOS and iOS development for over two decades until Swift was introduced in 2014.
Cricket analogy: Just as Kapil Dev's all-round game blended raw pace bowling with disciplined batting into one hybrid skill set, Objective-C blends C's low-level control with Smalltalk's dynamic messaging into one hybrid language.
Objective-C's Role in the Apple Ecosystem
Objective-C is the language behind Cocoa on macOS and Cocoa Touch on iOS, the application frameworks that trace their lineage directly to NeXTSTEP's original object libraries. Even though Swift is now Apple's recommended language, Objective-C remains essential for maintaining large legacy codebases such as older enterprise iOS apps, and Swift projects routinely interoperate with Objective-C classes through bridging headers.
Cricket analogy: Like how the MCC's original 1787 laws of cricket still underpin today's T20 rulebook even as the format evolved, Cocoa's class libraries still underpin modern iOS apps even as Swift took over.
Message Passing vs Function Calls
Objective-C's most distinctive feature is its bracket-based message syntax, written as [receiver message] or [receiver messageWithArgument:value], which is resolved dynamically at runtime through the objc_msgSend function rather than bound statically at compile time. This dynamic dispatch, combined with the id type that can point to any object regardless of class, lets Objective-C support duck typing, method swizzling, and runtime introspection in ways that statically typed languages like Swift restrict by design.
Cricket analogy: Like a captain like MS Dhoni deciding which bowler to throw the ball to only after seeing the batsman's stance at the crease, objc_msgSend decides which method to run only at runtime, not compile time.
#import <Foundation/Foundation.h>
@interface Greeter : NSObject
- (void)greet:(NSString *)name;
@end
@implementation Greeter
- (void)greet:(NSString *)name {
NSLog(@"Hello, %@! Welcome to Objective-C.", name);
}
@end
int main(void) {
@autoreleasepool {
Greeter *g = [[Greeter alloc] init];
[g greet:@"Ada"];
}
return 0;
}NeXT, the company Steve Jobs founded after leaving Apple in 1985, built Objective-C into the foundation of NeXTSTEP. When Apple acquired NeXT in 1996 for roughly $400 million, it inherited both Objective-C and the engineering team that would later ship Mac OS X.
Objective-C is no longer Apple's recommended language for new projects, Swift has held that position since 2014, but treat it as a legacy skill, not a dead one: many production iOS and macOS codebases, especially older enterprise apps and system-level frameworks, are still substantially Objective-C and require developers who can read and maintain it.
- Objective-C is a strict superset of C, adding Smalltalk-style object messaging via square-bracket syntax.
- It was created by Brad Cox and Tom Love in the early 1980s and became NeXTSTEP's primary language.
- Apple's 1996 acquisition of NeXT made Objective-C the foundation of Cocoa and Cocoa Touch.
- Method calls are dispatched dynamically at runtime through objc_msgSend, not resolved at compile time.
- The id type can reference any object, enabling dynamic, duck-typed programming patterns.
- Swift has replaced Objective-C as Apple's recommended language since 2014, but Objective-C remains critical for legacy code.
Practice what you learned
1. Who created Objective-C, and what two languages did they combine?
2. Which function performs Objective-C's dynamic method dispatch at runtime?
3. What event brought Objective-C into Apple's core platforms?
4. Since which year has Swift been Apple's recommended language over Objective-C?
5. What Objective-C feature lets a variable reference an object of any class without a cast?
Was this page helpful?
You May Also Like
Installing Xcode and Setup
How to install Xcode, set up a new Objective-C project, and compile Objective-C from the command line.
Objective-C Syntax and Variables
How Objective-C extends C syntax with object messaging, and how primitive versus object variables are declared.
Your First Objective-C Program
Writing, compiling, and running a first Objective-C 'Hello, World!' program from the terminal.
Related Reading
Related Study Notes in Programming
Browse all study notesApache Spark Study Notes
Programming · 30 topics
ProgrammingApache Flink Study Notes
Programming · 30 topics
ProgrammingHadoop Study Notes
Programming · 30 topics
ProgrammingSnowflake Study Notes
Programming · 30 topics
ProgrammingApache Airflow Study Notes
Programming · 30 topics
Programmingdbt (Data Build Tool) Study Notes
Programming · 30 topics