gpt4 book ai didi

objective-c - 在 AppDelegate 中设置 NSTableView 数据源时发出警告

转载 作者:行者123 更新时间:2023-12-03 16:56:35 26 4
gpt4 key购买 nike

我有一个使用 NSTableView 的示例 cocoa 应用程序,但是当我为 NSTableView 设置 dataSource 时,会出现以下警告消息:

Sending 'AppDelegate *const __strong' to parameter of incompatible type 'id _Nullable'

在AppDelegate.h文件中

@interface AppDelegate : NSObject <NSApplicationDelegate, NSTabViewDelegate, NSTableViewDataSource>

在AppDelegate.m文件中

[self.userTableView setDataSource:self];
[self.userTableView setDelegate:self];

最佳答案

这是因为您需要确认您正在使用的两种协议(protocol)是否错过了 AppDelegate.h 中的 NSTableViewDelegate

关于objective-c - 在 AppDelegate 中设置 NSTableView 数据源时发出警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50407561/

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