0

在 ARC 之前,我会IBOulets在标题中声明如下:

- (IBOutlet) UIButton * aButton

@property (nonatomic, retain) IBOutlet UIButton * aButton;

然后在 .m 文件中

@synthesize aButton;

在 arc 下执行上述操作的等效正确方法是什么?我可以声明:

@property (weak)IBOutlet UIButton * aButton ?

谢谢。

4

2 回答 2

3
@property (strong)IBOutlet UIButton *aButton
于 2012-07-24T14:35:00.670 回答
1

在某些情况下,您可能希望改变强/弱属性。看看:在 ARC 下,IBOutlets 应该强还是弱?

在此处输入图像描述

于 2012-07-24T14:38:52.103 回答