这是一个非常基本的应用程序。编译时,它显示“构建成功”(“没有问题”)。当我单击模拟器中的应用程序图标时,它会运行一秒钟,然后自动关闭。我可以看到没有错误(比如运行时错误)。我应该在哪里寻找提示?
ClickButtonViewController.m 文件:
#import "ClickButtonViewController.h"
@implementation ClickButtonViewController;
@synthesize decisionText ;
-(IBAction)buttonPressed:(id)sender
{
decisionText.text = @"Go for it!" ;
}
-(void)dealloc{
[decisionText release];
[super dealloc] ;
}
- (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.
}
- (void)viewDidUnload {
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
@end
ClickButtonViewController.h 文件:
#import <UIKit/UIKit.h>
@interface ClickButtonViewController : UIViewController {
IBOutlet UILabel *decisionText ;
}
@property (nonatomic,retain) IBOutlet UILabel *decisionText ;
-(IBAction)buttonPressed:(id)sender;
@end