Note that there are some explanatory texts on larger screens.

plurals
  1. PObasic xcode iphone app not working, button clicks to change text?
    primarykey
    data
    text
    <p>I've followed the tutorial below, it basically just tells you to create a button and a label. When you click the button the label should change to some text.</p> <p><a href="http://paulpeelen.com/2011/03/17/xcode-4-ios-4-3-hello-world/" rel="nofollow">http://paulpeelen.com/2011/03/17/xcode-4-ios-4-3-hello-world/</a></p> <p>It runs but it shows a blank screen. When you click the screen it goes blue like the entire page is a button. I think it's loading the mainwindow.xib file instead of the default ViewController.xib</p> <p>Any ideas, I'm obviously missing something?</p> <p>Thanks</p> <p>EDIT</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; @interface fun_buttonViewController : UIViewController { UILabel *textLabel; } @property (nonatomic, retain) IBOutlet UILabel *textLabel; - (IBAction)changeTheTextOfTheLabel; @end </code></pre> <p>The implementation:</p> <pre><code>#import "fun_buttonViewController.h" @implementation fun_buttonViewController @synthesize textLabel; - (void)dealloc { [super dealloc]; [textLabel release]; } - (IBAction)changeTheTextOfTheLabel { [textLabel setText:@"Hello, World!"]; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle /* // Implement viewDidLoad to do additional setup after loading the view, typically from a nib. - (void)viewDidLoad { [super viewDidLoad]; } */ - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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