gpt4 book ai didi

objective-c - 将NSDictionary复制到NSArray

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

我有一个声明为NSDictionary的变量。如何将其复制到extern const NSArray变量?例如:

NSMutableDictionary *selectedItem = [self.dataArray objectAtIndex:indexPath.row];
[selectedItem setObject:[NSNumber numberWithBool:targetCustomCell.checked]
forKey:@"checked"];

最佳答案

allKeys返回包含所有键的NSArrayallValues返回包含所有值的NSArray

NSArray *keys = [myDict allKeys];
NSArray *values = [myDict allValues];

关于objective-c - 将NSDictionary复制到NSArray,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5788694/

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