在其中一個iPad應用程序中,我正在工作我已將自定義視圖添加到視圖。此工作正常,但現在我想要刪除所有添加的自定義視圖。如何執行此操作?如何刪除以編程方式添加的customviews?
以下是我添加自定義視圖
for (int col=0; col<colsInRow; col++) {
// NSLog(@"Column Number is%d",col);
x=gapMargin+col*width+gapH*col;
//self.styleButton=[[UIButton alloc] initWithFrame:CGRectMake(x, y, width, height)];
ComponentCustomView *componentCustomobject=[[ComponentCustomView alloc] initWithFrame:CGRectMake(x, y, width, height)];
componentCustomobject.backgroundColor=[UIColor redColor];
componentCustomobject.componentLabel.text=[appDelegate.componentsArray objectAtIndex:row];
[self.formConatinerView addSubview:componentCustomobject];
tempCount1++;
}