#import "CLSViewController.h"
@implementation CLSViewController
@synthesize statusText = _statusText;
- (void)viewDidUnload {
[self setStatusText:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (IBAction)buttonPressed:(UIButton *)sender {
NSString *title = [sender titleForState:UIControlStateNormal];
-> statusText.text = [NSString stringWithFormat:@"%@ button pressed.", title];
}
@end
表示 statusText.text = ... 的行
我没有正确合成它吗?= _statusText;
从中删除它可以消除错误,但我认为我们应该将其设置为某些东西。