ios 遍历makeObjectsPerformSelector
2019-02-20 本文已影响0人
1234yws
//集合或数组里面的每一个元素都去执行 aSelector
- (void)makeObjectsPerformSelector:(SEL)aSelector NS_SWIFT_UNAVAILABLE("Use enumerateObjectsUsingBlock: or a for loop instead");
//使用方法
[self.smallScrollView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
//集合或数组里面的每一个元素都去执行 aSelector 。且把 withObject 后边的 argument 对象做为参数传给方法 aSelector。
- (void)makeObjectsPerformSelector:(SEL)aSelector withObject:(nullable id)argument NS_SWIFT_UNAVAILABLE("Use enumerateObjectsUsingBlock: or a for loop instead");
//使用方法
//argument作为对象参数传递给aSelector,然后循环之行
[self.array makeObjectsPerformSelector:@selector(setHidden:) withObject:@YES];