Class prefixes

Objective-C is not namespaced. This means that if you write a program with a class called Person in it, and you link in a library of someone else’s code that also declares a Person class, then the compiler will not be able to tell these two classes apart, and you will get a compiler error.

To prevent name collisions like this, Apple recommends that you prefix each of your class names with three or more letters, to make your class names more unique and less likely to collide with someone else’s class name. Most developers use either their company’s or their project’s initials. In this book, we use the BNR class prefix.

Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.