gpt4 book ai didi

iphone - iOS 警告 : Implicit declaration of function 'pathInDocumentDirectory'

转载 作者:行者123 更新时间:2023-12-01 19:27:28 25 4
gpt4 key购买 nike

在尝试开发我的第一个 iPhone 应用程序时,我收到“ 函数 'pathInDocumentDirectory' 函数的隐式声明|”警告:

NSString *imagePath = pathInDocumentDirectory(s);

奇怪的是,我找不到任何关于如何处理此问题的好信息。有谁知道如何摆脱警告?谢谢!

最佳答案

如果这是一个内联函数,请将声明移动到实现文件的顶部(在任何使用它之前)。

如果它是您编写的方法,它应该是一个objective-c方法......

-(NSString *)pathInDocumentDirectory:(NSString *)value {

}

然后你用...
NSString *path = [self pathInDocumentsDirectory:aValue];

不要忘记在实现文件的头文件或私有(private)类别中声明该方法。

关于iphone - iOS 警告 : Implicit declaration of function 'pathInDocumentDirectory' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6113196/

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