gpt4 book ai didi

cocoa - IBOutlet 属性薄弱和 ARC 问题

转载 作者:行者123 更新时间:2023-12-03 17:04:53 25 4
gpt4 key购买 nike

我的代码:

@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;

我对此文件打开了 arc,并且该项目是新创建的。不是从非 arc 项目转换而来。

最佳答案

我已将我的评论提升为答案:

Please take a look at this question: Which iOS classes that don't support zeroing weak references? You can't create weak references to classes which don't support weak references to their instances.

关于cocoa - IBOutlet 属性薄弱和 ARC 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12040304/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com