NSArray 类定义的方法
makeObjectsPerformSelector:@select(aMethod)
简介:让数组中的每个元素 都调用 aMethod
makeObjectsPerformSelector:@select(aMethod)
withObject:oneObject
简介:让数组中的每个元素 都调用 aMethod 并把 withObject 后边的 oneObject 对象做为参数传给方法aMethod
[array makeObjectsPerformSelector:@selector(setRecurringDelegate:) withObject:self];
/将检测到的该自动插入的交易插入数据库/
[array makeObjectsPerformSelector:@selector(insertRecursion)];
/将检测到的该自动插入的交易插入数据库/
本文详细介绍了NSArray类中的两个方法:makeObjectsPerformSelector:@select(aMethod) 和 makeObjectsPerformSelector:@select(aMethod) withObject:oneObject。前者能够让数组中的每个元素调用指定的方法aMethod,而后者则在此基础上为aMethod传递了一个额外的对象参数。通过具体的代码示例展示了如何使用这两个方法来处理数组中的对象。
175

被折叠的 条评论
为什么被折叠?



