gpt4 book ai didi

iphone - 如何从 NSMutableArray iPhone 应用程序中查找特定对象?

转载 作者:可可西里 更新时间:2023-11-01 06:18:32 25 4
gpt4 key购买 nike

我在 NSMutableArray 中存储了很多值,例如 @"New"@"Old"@"Future"NSMutablArray 有 100 多个对象。我需要从数组中找到 @"New" 对象。谁能帮我解决这个问题?提前致谢。

最佳答案

这将以最经济的方式实现[测试]:

[myArray filteredArrayUsingPredicate:[NSPredicate
predicateWithFormat:@"self == %@", @"New"]];

关于iphone - 如何从 NSMutableArray iPhone 应用程序中查找特定对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11886746/

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