1. What is Objective-C?
Objective-C is a general-purpose, object-oriented programming language that adds Smalltalk-style messaging to the C programming language. It was the main programming language supported by Apple for macOS and iOS before Swift. code Objective-C NSLog(@"Hello, World!");
NSLog(@"Hello, World!");
2. Why use Objective-C?
While Swift is newer, Objective-C is still heavily used to maintain massive legacy codebases in Apple ecosystems. It offers a very dynamic runtime and deep integration with C/C++ libraries.
3. Who developed Objective-C?
It was created by Brad Cox and Tom Love in the early 1980s at their company Stepstone, and was later adopted by NeXT (and subsequently Apple) as the foundation for their operating systems.
4. What is Objective-C based on?
It is built on top of the C programming language, meaning any valid C program is a valid Objective-C program. It adds object-oriented capabilities heavily inspired by Smalltalk.
5. What is .h file?
The `.h` file is the Header file. It contains class declarations, exposing properties and method signatures to the rest of the application so they know how to interact with the class. code Objective-C @interface MyClass : NSObject - (void)doSomething; @end
@interface MyClass : NSObject
- (void)doSomething;
@end