gpt4 book ai didi

ios - NSDictionary的 list

转载 作者:行者123 更新时间:2023-12-01 17:17:35 24 4
gpt4 key购买 nike

我有一些plist数据,如下图所示:

如果在UIDatePicker上选择了一个等于CDate的NSDate,我该如何访问“文本”值?

最佳答案

所以你基本上想要

NSString* path = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"plist"];
NSArray* a = [NSArray arrayWithContentsOfFile:path];
for (NSDictionary *d in a)
{
NSString *cdate = [d objectForKey:@"CDate"];
if ([cdate isEqualToString:@"Whatever is currently selected"])
{
NSString *text = [d objectForKey:@"Text"];
// do something with text here
}
}

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

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