简体   繁体   English

IBoutlet,2种不同的书写方式?

[英]IBoutlet , 2 Different ways to Write?

I am new to iPhone OS App development. 我是iPhone OS App开发的新手。 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 泰米尔

Apple现在建议您仅将IBOutlet声明放在@property

I just write IBOutlet in the @property declaration. 我只是在@property声明中编写IBOutlet It won't hurt to put it in both spots though. 不过,将其放在两个位置都不会有什么坏处。

You're not asking the difference between the whole lines though are you? 您不是在问整行之间的区别吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM