gpt4 book ai didi

ios - 无效的 CfStringRef plist(字典数组)iOS

转载 作者:行者123 更新时间:2023-11-29 04:42:08 26 4
gpt4 key购买 nike

我的文件中有以下代码

NSString *filePath = [[NSBundle mainBundle]pathForResource:@"images" ofType:@"plist"];
NSArray *array = [[NSArray alloc]initWithContentsOfFile:filePath];


for (id dict in array) {


NSLog(@"This is the id: %@" ,[dict objectForKey:@"Id"]);

}

当我在调试器上运行它时,它会在 NSString *filePath 行上显示“无效的 CfStringref”。

无论我尝试什么代码,我都无法克服这个问题。

有什么想法吗?

plist 也是一个字典数组,但我无法解析它们,因为代码无法工作

最佳答案

images.plist 不在您的“复制捆绑资源”构建阶段,请将其拖入并再次运行。

关于ios - 无效的 CfStringRef plist(字典数组)iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10236942/

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