Skip to content
BENIBIX Learn

Objective-C

Development🔤 LanguagesPopular Languages

Also known as ObjC, Objective C, Obj-C

The old way to code Apple apps, from before Swift. It is built on C.

Think of it like

It is like an old map of a town. Most people now use the new one.

Example

Emma joins a team with a ten-year-old iPhone app. Half of it is Objective-C, and new screens are written in Swift.

Why it matters

Lots of working Apple code is in it. Someone has to read and fix that code.

Definition

Objective-C is a language that adds objects and messages to C. For many years it was the main language for Apple's Mac and iPhone apps. In 2014, Apple brought out Swift as the newer choice. Many older apps and Apple's own tools still hold Objective-C code. Swift and Objective-C can work side by side in one app.

Example code

objectivec
NSString *name = @"Lucy";
NSLog(@"Hello, %@", name);
Objective-C marks its strings with @ and prints with NSLog.
It sits on the shelf near the hardware, by the phone.

Common mistake

Starting a new Apple app in it. Swift is the default now, and most new guides use it.

Key takeaways

  1. 1
    C plus objects. Built on top of C.
  2. 2
    Apple's older choice. Before Swift.
  3. 3
    Mixes with Swift. Both work in one app.

Learn it properly