apple保留两个字母的前缀,建议用三个字母做前缀

来源:互联网 发布:淘宝如何看买家的评价 编辑:程序博客网 时间:2024/06/05 15:30

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.


apple建议用三个字母做前缀
0 0
原创粉丝点击