Objective-C Cheat Sheet

This section documents modern Objective-C as implemented by Apple Clang in the current Xcode release — Objective-C 2.0 plus ARC, literals and subscripting, instancetype, Clang modules, lightweight generics, nullability and @available — as published at Apple Developer Documentation and the Clang Objective-C specifications, which are the references these pages are written and verified against.

This content was generated with the assistance of AI and should be verified against developer.apple.com before being relied on in production.

This section’s bibliography lists the reference material consulted while preparing these pages.

A single-page, colour-coded summary of the Objective-C essentials — the core types (id, BOOL, SEL, nil), the @interface/@implementation skeleton, method declaration and message-send syntax, alloc/init and the initializer patterns, the full @property attribute table, categories, class extensions and protocols, block syntax with block and weak, literals and subscripting, NSString, NSArray and NSDictionary quick examples, fast enumeration, the ARC ownership qualifiers and bridging casts, the NSError and @try patterns, GCD one-liners, KVC and KVO calls, the runtime and Swift-interop annotations, and the clang/gnustep-config build commands — handy for quick memorization or as a printable desk reference.

For the full explanation, every option, and additional examples, see the dedicated pages:

Memory management — Manual Retain Release and Automatic Reference Counting.

Error handling — Errors and Exceptions.

Concurrency — Concurrency.