tags:

views:

40

answers:

2

Hi,

I have developed a program with UIButtons with a navigationBar, now i do not know how to get a view by clicking a Button. When i click the button it should show me a different view. I also want to know after passing to the view, how to navigate back to the before view programatically?

+1  A: 

You want pushViewController:animated: and popViewControllerAnimated:.

Take a look at the UINavigationController documentation.

David Kanarek
A: 

Also u also develop something like this,

CGRect cg = CGRectMake(130.0, 220.0, 100.0, 30.0);
    UIButton *btn = [[UIButton alloc] initWithFrame:cg];
    btn.showsTouchWhenHighlighted = YES;
    btn.backgroundColor = [UIColor blueColor];
    [btn addTarget:self action:@selector(Showlbl:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:btn];

And give the proper button event in above part,

action:@selector(Showlbl:) 
RRB
hi thanks for the answer. The coding that u have stated is fine but i want to know how to place a simple view inside the method Showlbl:. Such that whenever i press the button that action should be to view another page.
Cathy