In order to keep class names unique, the convention is to use prefixes on all classes. You’ll have noticed that Cocoa and Cocoa Touch class
names typically start either with NS or UI.
Two-letter prefixes like these are reserved by Apple for use in framework classes. As you learn more about Cocoa and Cocoa Touch, you’ll encounter a variety of other prefixes that relate to specific frameworks...
Your own classes should use three letter prefixes. These might relate to a combination of your company name and your app name, or even a specific component within your app. As an example, if your company were called Whispering Oak, and you were developing a
game called Zebra Surprise, you might choose WZS or WOZ as your class prefix.
为保持类名唯一性,通常使用特定前缀。苹果官方推荐两字母前缀用于框架类,如 NS 和 UI;自定义类推荐采用三字母前缀,例如结合公司名与应用名。

457

被折叠的 条评论
为什么被折叠?



