gpt4 book ai didi

ios - 词典词典

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

您好,我正在尝试在 ios 中的指定位置 ( ios 路径) 但它显示错误,即无法读取数据,因为它的格式不正确。

代码片段:

NSArray *arrayDirctories=NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask,YES); 
NSString *libraryPath=[arrayDirctories objectAtIndex:0];
NSString *filePath = [libraryPath stringByAppendingPathComponent:@"Hello/breaches.plist"];
NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
NSMutableDictionary *socialDict = [[NSMutableDictionary alloc] init];
[socialDict setObject:arr forKey:@"count"];
[socialDict setObject:sitesArr forKey:@"sites"];
[socialDict setObject:timeArr forKey:@"time"];
[dict setObject:socialDict forKey:@"social"];
[dict writeToFile:filePath atomically:1];

请任何人找到我解决这个问题的出路。提前致谢。

最佳答案

但它对我有用..

 NSArray*arr=[[NSArray alloc]initWithObjects:@"1",@"2",@"3", nil];
NSArray*sitesArr=[[NSArray alloc]initWithObjects:@"1",@"2",@"3", nil];
NSArray*timeArr=[[NSArray alloc]initWithObjects:@"1",@"2",@"3", nil];

NSMutableDictionary *dict = [[NSMutableDictionary alloc] init];
NSMutableDictionary *socialDict = [[NSMutableDictionary alloc] init];
[socialDict setObject:arr forKey:@"count"];

[socialDict setObject:sitesArr forKey:@"sites"];
[socialDict setObject:timeArr forKey:@"time"];
[dict setObject:socialDict forKey:@"social"];
// [dict setValuesForKeysWithDictionary:socialDict];
[dict writeToFile:filePath atomically:1];

.plist 文件是

enter image description here

关于ios - 词典词典,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27873953/

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