【发布时间】:2012-07-24 14:32:02
【问题描述】:
在 ARC 之前,我会在标题中声明 IBOulets,如下所示:
- (IBOutlet) UIButton * aButton
@property (nonatomic, retain) IBOutlet UIButton * aButton;
然后在.m文件中
@synthesize aButton;
在 arc 下执行上述操作的等效正确方法是什么?我可以声明吗:
@property (weak)IBOutlet UIButton * aButton ?
谢谢。
【问题讨论】:
-
文档说您应该使用
strong指针作为网点,但如果您使用weak或unsafe_unretained指针作为UIView内的静态网点,这会被@987654330 捕获@指针也一样,以后不会有问题了。 -
你曾经这样声明IBOutlet的...?
标签: iphone objective-c automatic-ref-counting iboutlet