[noobie] InsertSubView superimposes over existing view..

Discussion in 'iOS Programming' started by Streamer, Jan 31, 2010.

  1. Streamer macrumors member

    Apr 18, 2008
    I'm missing something obvious, but I have a tabBar type application which does what I want, except that on one the tab views, I have a button which will switch to another view except that when I execute the following line

    [ self.view insertSubview:newView.view atIndex:0];
    It does indeed show the new view except that it's superimposed over the original view and I can still select buttons on the old view as well as stuff on the new view.

    Any quick thoughts?

  2. uneebe macrumors newbie

    Feb 11, 2010
    You first have to remove your existing view before inserting a new one...

    You first have to remove your current view before inserting a new one...

    Try putting the following line of code before the " insertSubview: atIndex: " line

     [<firstView>.view  removeFromSuperview];

Share This Page