Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have added Label's and Switch's by this manner ...
when i move slider to increase the value then it should be added one by one as per slider value,,
but now i want to remove label's and switch's one by one as per i move the slider value in decreasing manner...

What I have tried:

//for creation of  UISwitch,,
for (int i=1; i<=self.slider.value; i++) {
            self.switch1=[[UISwitch alloc]initWithFrame:CGRectMake(x, y, 0, 0)];
            [self.resultTextView addSubview:self.switch1];
            x+=50;
            if (x>=280) {
                x=10;
                y+=35;
            }
        }

// for creation of  UILabel
for (int i=1; i<=self.slider.value; i++) {
            self.label1=[[UILabel alloc]initWithFrame:CGRectMake(x, y, 25, 25)];
            self.label1.text=[NSString stringWithFormat:@"%d",i];
            [self.resultTextView addSubview:self.label1];
            x+=30;
            if (x>=280) {
                x=10;
                y+=30;
            }
        }
Posted
Updated 21-Sep-16 19:30pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900