gpt4 book ai didi

iphone - 在哪里可以找到 @max.intValue

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:47:13 24 4
gpt4 key购买 nike

我使用以下代码获取最大值:

 NSArray *allValues = @[ [NSNumber numberWithInt:20],
[NSNumber numberWithInt:36],
[NSNumber numberWithInt:84],
[NSNumber numberWithInt:11],
[NSNumber numberWithInt:28]];

int max = [[allValues valueForKeyPath:@"@max.intValue"] intValue];
int min = [[allValues valueForKeyPath:@"@min.intValue"] intValue];

但是我有一个问题,什么文档可以告诉我KeyPath链接@max.intValue在哪里或@min.intValue.如果我知道我可以知道的关键路径做其他效果

最佳答案

您可以在 Key-Value Coding Programming Guide 中找到此信息:

@max

The @max operator compares the values of the property specified by the key path to the right of the operator and returns the maximum value found. The maximum value is determined using the compare: method of the objects at the specified key path. The compared property objects must support comparison with each other. If the value of the right side of the key path is nil, it is ignored.

@min

The @min operator compares the values of the property specified by the key path to the right of the operator and returns the minimum value found. The minimum value is determined using the compare: method of the objects at the specified key path. The compared property objects must support comparison with each other. If the value of the right side of the key path is nil, it is ignored.

关于iphone - 在哪里可以找到 @max.intValue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15611271/

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