Wrox Programmer Forums
|
BOOK: Beginning iOS 4 Application Development
This is the forum to discuss the Wrox book Beginning iOS 4 Application Development by Wei-Meng Lee; ISBN: 978-0-470-91802-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iOS 4 Application Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 29th, 2010, 07:27 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default OutletsAndActions

Hi,

Thanks for your great book, which I am enjoying a lot.
I would like your help on this.
I am working in the example OutletsAndActions. This App does not show any error when I run it, but when I click the App icon the Simulator gives me a black screen without any button or field. These are my .m and .h files:

//
// OutletsAndActionsViewController.m
// OutletsAndActions
//
// Created by Jose Espinel on 12/29/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "OutletsAndActionsViewController.h"

@implementation OutletsAndActionsViewController

//---synthesize the property---
@synthesize txtName;

//---display an alert view when the button is clicked---
-(IBAction) btnClicked:(id) sender {
NSString *str = [[NSString alloc]
initWithFormat:@"Hello!, %@", txtName.text];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Hello!"
message:str
delegate:self
cancelButtonTitle:@"Done"
otherButtonTitles:nil];
[alert show];
[str release];
[alert release];
}

- (void)dealloc {
//---release the outlet---
[txtName release];
[super dealloc];
}

@end

__________________________________________________ ______

//
// OutletsAndActionsViewController.h
// OutletsAndActions
//
// Created by Jose Espinel on 12/29/10.
// Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface OutletsAndActionsViewController : UIViewController {
//---declaring the outlet---
IBOutlet UITextField *txtName;


}
//---expose the outlet as property---
@property (nonatomic, retain) UITextField *txtName;

//---declaring the action---
-(IBAction) btnClicked:(id) sender;

@end
 
Old December 31st, 2010, 02:39 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Nobody there?

Nobody there to help me?
 
Old January 1st, 2011, 09:47 PM
Registered User
 
Join Date: Dec 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Never mind

Never mind, I already fixed the problem by myself.









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.