更改NSMutableArray中的值 [英] Change a value within a NSMutableArray
本文介绍了更改NSMutableArray中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个装载了值的NSMutableArray。
在应用程序的后面,我需要更改数组中的一个元素的值。 p>
如何完成这项工作?
感谢
tony
解决方案
查看类引用实例方法:
您可以使用:
code> replaceObjectAtIndex:withObject:给定你知道对象的索引。
replaceObjectsAtIndexes:withObjects:
可立即替换多个对象。
I have a NSMutableArray that is loaded with values.
Later in the application, I need to change the values of one of the elements in the array.
How do I accomplish this?
thanks tony
解决方案
Take a look at the class reference instance methods:
You can use:
replaceObjectAtIndex:withObject:
given you know the index of the object.
replaceObjectsAtIndexes:withObjects:
to replace multiple objects at once.
这篇关于更改NSMutableArray中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文