0

This is a general question in IOS. I have a view which is having some subviews (i have added those views using insertSubview:atIndex: method). If I remove those subviews by removeFromSuperview method, my main view will shown up, but all GUI actions are very slow in that view. for example: If I click text field on the main view , the keyboard appears very slowly and goes down slowly too. I don't know what have I done wrong. Any idea ?

Here is a sample code. self is my main view, I'm adding other two views in it.

(void) begin_action {
                subview1 =[[test_subview1 alloc] init];
                [self.view insertSubview:[self. subview1.view] atIndex:0];

        subview2 =[[test_subview2 alloc] init];
                [self.view insertSubview:[self.subview2.view] atIndex:1];
    }

    end_of_action {
           [self. subview1.view removeFromSuperview];
           [self. subview2.view removeFromSuperview];

           self. subview1 = nil;
           self. subview2 = nil;
    }

Other than this anything I need to do two remove a view?

thanks in Advance.

Feroz
  • 699
  • 5
  • 17
  • 25

1 Answers1

0

Did you check this on an actual device? Also, try restarting the simulator – tipycalFlow

Feroz
  • 699
  • 5
  • 17
  • 25