[noobie] InsertSubView superimposes over existing view..

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

  1. Streamer macrumors member

    Joined:
    Apr 18, 2008
    #1
    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

    Code:
    [ 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?

    Thanks
     
  2. uneebe macrumors newbie

    Joined:
    Feb 11, 2010
    #2
    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


    Code:
     [<firstView>.view  removeFromSuperview];
     

Share This Page