您的位置:首页 > 移动开发

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

2014-03-13 09:40 309 查看
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建议用三个字母做前缀
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: