【发布时间】:2012-08-02 04:38:53
【问题描述】:
在objective-c中,我可以声明一个带有类型的UI变量吗?:
UIButton *btn_Add,*btn_showMessage or UILabel *lb_Title
怎么样:UIButton *btnAdd,*btnShowMessage or *lbTitle
非常感谢
【问题讨论】:
-
顺便说一句,您还缺少
*s。
在objective-c中,我可以声明一个带有类型的UI变量吗?:
UIButton *btn_Add,*btn_showMessage or UILabel *lb_Title
怎么样:UIButton *btnAdd,*btnShowMessage or *lbTitle
非常感谢
【问题讨论】:
*s。
我更喜欢addButton、showMessageButton、titleLabel等
【讨论】:
引用coding guidlines for Cocoa: Code Naming Basics:
所以,是的,无论是 nonamelive 提议的,还是尽可能尝试摆脱“按钮”前缀/后缀。
【讨论】: