【发布时间】:2012-03-04 13:58:55
【问题描述】:
在这段代码中:
#import <UIKit/UIKit.h>
@interface ViewController : UIViewController
{
UILabel *labelsText;
}
@property(strong, nonatomic) IBOutlet UILabel *labelsText;
-(IBAction) clicked: (id) sender;
@end
1。 带有@property 的行.. 据我了解,这是@property(blabla) 数据类型变量 但是代码有3个东西? IBoutlet、UIlabel 和 *labelsText
2。 单击的功能将根据按下的按钮更改标签内容,因为两个按钮都连接到该功能。 但它返回一个 IBAction?更改标签文本的代码在函数中,它从不返回任何内容?它可以很容易地被 -(void) 代替吗?
【问题讨论】:
标签: iphone automatic-ref-counting