Note that there are some explanatory texts on larger screens.

plurals
  1. POiphone switch views with buttons, SecondView over FirstView
    text
    copied!<p>to all im newbie developer and trying to create my first iPhone app, <em>sorry my english not good</em></p> <p>i trying to make 2 views and the second view display over first view, but the second view is not full screen, is 320x400 i cut 80pixels, to see the buttons from the first view... and i making that with tutorials from one book, but in book he making 1 button on first view and 1 another button in the second view... and i need 2 buttons on the first view, and can't make it. please help me... i think is very easy but i dont know how to..</p> <p>with this code make in book what i reading</p> <hr> <pre><code>**FirstView.h** </code></pre> <p>#import UIKit/UIKit.h</p> <p>@interface FirstView : UIViewController { }</p> <p>/<em>--- declare an action for the Button view ---</em>/ </p> <p>-(IBAction) goToSecondView:(id) sender;</p> <p>@end</p> <pre><code>**FirstView.m** </code></pre> <p>#import "FirstView.h"</p> <p>#import "SecondView.h"</p> <p>@implementation FirstView</p> <p>SecondView *secondView;</p> <p>-(IBAction) goToSecondView:(id) sender{</p> <p>secondView = [[SecondView alloc] initWithNibName:nil bundle:nil]; [self.view addSubview:secondView.view];</p> <p>}</p> <p>-(void)dealloc { [SecondView release];</p> <p>[super dealloc]; }</p> <pre><code>**SecondView.h** </code></pre> <p>#import @interface SecondView : UIViewController { }</p> <p>/*--- action for the Return button --- */</p> <p>-(IBAction) goToFirstView:(id) sender;</p> <p>@end</p> <pre><code>**SecondView.m** </code></pre> <p>#import "SecondView.h"</p> <p>@implementation SecondView</p> <p>-(IBAction) goToFirstView:(id) sender { </p> <p>[self.view removeFromSuperview];}</p> <p>And after linking on Interface Builder one button (goToSecondView) on the first view, and one button on the SecondView(goToFirstView).... and i want to make this two buttons on the first view.</p> <p><strong><em>Help me please!</em></strong> , thank you.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload