Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have a UiView called TestView which I have added as a subView of my NumberViewController.

On start of my app, My rootViewController is PaperViewController, this has some UIButtons which I have added through xib, Now I wanted to add NumberViewController's view as a subView of PaperViewController, so I did this

 NumberViewController = [[NumberViewController alloc] initWithNibName:@"NumberViewController" bundle:nil];
    NumberViewController.delegate = self;
    [self.view addSubview:NumberViewController.view];
    NumberViewController.view.backgroundColor = [UIColor clearColor];
    NumberViewController.view.hidden = YES;

Now this is hidden because, I will unhide it on click of some button and then I will show NumberViewContrller's view.This all works fine.

But suppose I added some buttons in PaperViewController through code, and then unhide NumberViewController's view , then both views overlap.

I am not understanding what is the problem, and what mistake I am making. So friends please help me out

Regards Ranjit.

share|improve this question
Why do you add the second view controller view as subview instead presenting the second view controller? – jcesar Apr 8 at 9:54
@jcesar bcoz, I want to show it instantly and not as modalView. – Ranjit Apr 8 at 10:00
Can you please post your code how you add button programatically and unhide view ? – Janak Nirmal Apr 8 at 10:01
Sorry,your question is not clear to me, what you want to achieve exactly? – iDeveloper Apr 8 at 10:06
@Jennis, the code to add button programatically is the std one. – Ranjit Apr 8 at 10:07
show 10 more comments

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.