Naming

Naming conventions are used within the Cocoa frameworks. These conventions are optional, but they are a good standard to follow. The conventions indicate the intended scope and usage of the item being named. Scope refers to the region of a program in which a name is known, and is usually enforced by the compiler. Usage refers to the intended use of the named item. Even in cases where the compiler does not enforce the usage limitations, the usage clues should be respected.

If you do not follow Cocoa’s naming conventions, your code will look odd when intermixed with code that uses Cocoa objects. Other programmers might be misled or confused about the meaning of your code.

Prefixes

Many symbol names in the Cocoa frameworks begin with the ...

Get Cocoa® Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.