弱IBOutlet属性和ARC问题

时间:2012-08-20 15:12:09

标签: cocoa automatic-ref-counting weak-references iboutlet

我的代码:

@interface WBMessageTableCellView : NSTableCellView

@property (weak) IBOutlet NSTextField *authName;
@property (weak) IBOutlet NSTextField *createdTime;
@property (weak) IBOutlet NSImageView *userProfileImageView;

@property (weak) IBOutlet NSTextView *statusTextView;

@end

但是我收到了这个错误, enter image description here 这有什么不对?我必须将我的代码更改为此,并且它可以正常工作,

@interface WBMessageTableCellView : NSTableCellView
{
    IBOutlet NSTextView *statusTextView;
}

@property (weak) IBOutlet NSTextField *authName;
@property (weak) IBOutlet NSTextField *createdTime;
@property (weak) IBOutlet NSImageView *userProfileImageView;

@property NSTextView *statusTextView;

我在此文件上打开了弧,并且新创建了该项目。没有从非弧项目转换。

1 个答案:

答案 0 :(得分:2)

我已将评论提升为答案:

  

请看一下这个问题:   Which iOS classes that don't support zeroing weak references?   你不能创建对不支持弱的类的弱引用   引用他们的实例。

相关问题