gpt4 book ai didi

objective-c - Objective C - 没有以前的函数原型(prototype)

转载 作者:行者123 更新时间:2023-12-03 16:52:53 24 4
gpt4 key购买 nike

我有 2 个方法向我发出警告:

id LoadObjectFromFile(NSString* filename) {
if ((filename = DocumentPath(filename, NO))) {
return [NSKeyedUnarchiver unarchiveObjectWithFile: filename];
} else {
return nil;
}
}

BOOL saveObjectWithFile(NSString* filename, id object) {
if ((filename = DocumentPath(filename, YES))) {
return [NSKeyedArchiver archiveRootObject: object toFile: filename];
} else {
return NO;
}
}

这给了我一个“没有以前的函数原型(prototype)”警告。

我不想只是禁用 xcode 中的警告。

我哪里出错了?

最佳答案

这是 C 函数,而不是客观的 C 方法。您是否在 .h 文件中定义了它们?

关于objective-c - Objective C - 没有以前的函数原型(prototype),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8202892/

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