iOS入门数组遍历

Posted wp7ers

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了iOS入门数组遍历相关的知识,希望对你有一定的参考价值。

数组的makeObjectsPerformSelector:SEL方法来减少自己写循环代码.
 [self.answerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
 

 1.  makeObjectsPerformSelector:@select(aMethod)

     简介:让数组中的每个元素 都调用 aMethod 

 2.  makeObjectsPerformSelector:@select(aMethod) withObject:oneObject

     简介:让数组中的每个元素 都调用 aMethod  并把 withObject 后边的 oneObject 对象做为参数传给方法aMethod

[array makeObjectsPerformSelector:@selector(setRecurringDelegate:) withObject:self]; /*将检测到的该自动插入的交易插入数据库*/
 
[array makeObjectsPerformSelector:@selector(insertRecursion)];
/*将检测到的该自动插入的交易插入数据库*/

以上是关于iOS入门数组遍历的主要内容,如果未能解决你的问题,请参考以下文章