查找 NSArray 中的最大数值
我有一个 NSNumbers 的 NSArray,想要找到数组中的最大值。是否有任何内置功能可以做到这一点?我正在使用 iOS4 GM,如果这有什么区别的话。
I have an NSArray of NSNumbers and want to find the maximum value in the array. Is there any built in functionality for doing so? I am using iOS4 GM if that makes any difference.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
KVC 方法如下所示:
或者
将数字作为 NSArray
The KVC approach looks like this:
or
with numbers as an NSArray
这是swift版本
Here is the swift version
希望对您有帮助。
Hope will helpful to you.