gpt4 book ai didi

objective-c - 定义方法时,我在 Objective-C 中的语法有什么问题?

转载 作者:行者123 更新时间:2023-12-03 17:42:13 26 4
gpt4 key购买 nike

-(NSMutableArray *) forwardInterfaceList: (networkInterface *) i;

我收到错误“‘networkInterface’之前预期有‘)’”

整个实现部分在这里:

@interface device : NSObject{

NSString *hostname;
NSMutableArray *intList;
}

-(NSMutableArray *) forwardInterfaceList: (networkInterface *) i;
-(NSMutableArray *) intList;
@end

最佳答案

你的类名应该使用大写...但除此之外,您可能在范围内没有该名称,这可以通过导入其声明或进行前向声明来修复...

@class NetworkInterface;

关于objective-c - 定义方法时,我在 Objective-C 中的语法有什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10067981/

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