如何确定Objective C中的数组索引? [英] How to determine an array index in Objective C?

查看:185
本文介绍了如何确定Objective C中的数组索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个数组在Objective C和我需要找到什么索引,所以我可以插入它在同一个地方。例如,让我说一个名称数组和年龄数组。我如何知道在名称数组中有什么索引charlie,所以我知道在age数组中插入他的年龄?

I have two arrays in Objective C and I need to find what index something is so I can insert it in the same place. For instance, lets say I have a "name array" and an "age array". How do I find out what index "charlie" is in the "name array" so I know where to insert his age in the "age" array?

p>

推荐答案

- [NSArray indexOfObject:] 似乎是合乎逻辑的选择。

-[NSArray indexOfObject:] would seem to be the logical choice.

这篇关于如何确定Objective C中的数组索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆