gpt4 book ai didi

ios - NSURL 可能不响应警告 +encryptedFileWithPath

转载 作者:行者123 更新时间:2023-11-29 04:59:47 24 4
gpt4 key购买 nike

我正在使用以下代码,该代码出现警告。代码确实显示了正确的图像 - 但我怎样才能摆脱警告?

NSString *indexPath = [[NSBundle mainBundle] pathForResource:name ofType:@"png" inDirectory:@"tunes"];
NSURL *url = [NSURL encryptedFileURLWithPath:indexPath];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *image = [[UIImage alloc] initWithData:data];

警告“NSURL 可能不会响应 +encryptedFileWithPath:”

最佳答案

这是因为 NSURL 没有名为“encryptedFileWithPath:”的方法。如果您已从 here 复制了代码,您可能没有仔细阅读这篇文章:

If you are familiar with NSURL and its class methods then you may have spotted the unfamiliar encryptedFileURLWithPath: method. I have extended NSURL using a category to add this method as a convenience.

关于ios - NSURL 可能不响应警告 +encryptedFileWithPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7236153/

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