IBoutlet , 2 种不同的书写方式?
我是 iPhone 操作系统应用程序开发新手。有人可以解释一下有什么区别吗
IBOutlet UIButton *myButton;
@property(非原子,保留)IBOutlet UIButton *myButton;
据我了解,第一行之前使用过,现在我们可以使用第二行。完全没有必要两个都写。有什么想法吗?
泰穆尔
I am new to iPhone OS App development. Can somebody explain whats the difference between
IBOutlet UIButton *myButton;
@property (nonatomic, retain) IBOutlet UIButton *myButton;
As far i understand the first line was used earlier and now we can use the 2nd line. Theres absolutely no need to write both of them. Any idea?
Taimur
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Apple 现在建议您仅将
IBOutlet
声明放在@property
上。Apple now recommends that you only put the
IBOutlet
declaration on the@property
.我只是在 @property 声明中写入
IBOutlet
。不过,把它放在两个地方也没什么坏处。你不是在问整行之间的区别吗?
I just write
IBOutlet
in the @property declaration. It won't hurt to put it in both spots though.You're not asking the difference between the whole lines though are you?