Differences to Objective-C 2.0

If you know Apple’s Objective-C, most of what you know carries over. But mulle-objc made deliberate choices: it takes Objective-C back toward its lean 1.0 roots and cherry-picks the later improvements worth keeping. So a few features you might reach for aren’t here — on purpose.

(“Objective-C 2.0” is Apple’s name for the modern dialect it shipped from 2007 on — the one that added ARC, blocks, dot syntax and the rest. That’s the baseline this chapter measures against; the “2.0” features below are the ones mulle-objc chose to leave out.)

Here’s the map, so nothing surprises you.

What’s not here

Feature Status Note
ARC never Manual reference counting instead. See Memory Management.
Blocks (^) not planned GCD is an Apple technology needing kernel support.
Dot syntax (obj.prop) not planned Use [obj prop] / [obj setProp:x].
@synchronized not planned Use locks from mulle-thread.
weak / strong never Use retain/copy; assign for non-owning refs.
atomic properties never Properties aren’t atomic by default.
Lightweight generics (NSArray<NSString *>) never Not in the cards.
Class extensions (@interface Foo ()) never The empty-parentheses extension used to declare private properties/ivars in the .m. Declare them in the main @interface, or add methods through a named category.
Subscripting (array[0]) not planned Operator-overloading-ish, un-C-like.
@import / modules not planned Use #import.
Objective-C++ never But the instance layout aims to stay C++-compatible.
nullable / nonnull not planned Objective-C is nullable by design; the keyword is superfluous.

What’s different

A few things exist but behave differently than you might expect:

  • BOOL is an int, not a one-byte type. If you truly need a one-byte boolean, use _Bool.
  • unichar is 32-bit (UTF-32), not 16-bit. See Strings and Unicode.
  • Protocol is not an object you can message. There is no Protocol * class the way Apple has one.
  • NSLog — you’ll use mulle_printf instead throughout.
  • @encode works, roughly 90% compatible with the Apple runtime.

Why bother without all that?

Fair question. The payoff for the subtractions is a runtime that is small, fast, fully portable C, and yours to build anywhere — no Apple dependency, no hidden magic. mulle-objc keeps the parts of Objective-C that make it a joy — dynamic messaging, categories, protocols, nil-eating — and drops the parts that tied it to one vendor’s platform.

IMO it’s a good trade. You lose some sugar; you gain a language you can take anywhere C goes.

Terminology

Wording Meaning
not supported might accidentally work; don’t rely on it
not planned probably won’t happen
never it’s not happening