Open Bretra opened 6 years ago
for (int i = 0; i < lines; ++i) { for (int j = 0; j < cols; ++j) { FaceButton btn = [FaceButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(jitem+edgeDistance+jhMargin,iitem+(i+1)*vMargin,item,item); [btn addTarget:self action:@selector(faceBtnClick:) forControlEvents:UIControlEventTouchUpInside]; [self.contentView addSubview:btn]; [array addObject:btn]; } }
这样做不是要消耗很多内存吗?
for (int i = 0; i < lines; ++i) { for (int j = 0; j < cols; ++j) { FaceButton btn = [FaceButton buttonWithType:UIButtonTypeCustom]; btn.frame = CGRectMake(jitem+edgeDistance+jhMargin,iitem+(i+1)*vMargin,item,item); [btn addTarget:self action:@selector(faceBtnClick:) forControlEvents:UIControlEventTouchUpInside]; [self.contentView addSubview:btn]; [array addObject:btn]; } }
这样做不是要消耗很多内存吗?