私は次のようにdot-mファイル内に「decisionText」のラベルコードを持っています:
@synthesize decisionText ; //<<<This generates the error
dot-hファイル内では、コードは次のように記述されています。
IBOutlet UILabel *decisionText
私が得るエラーは次のとおりです:インターフェースにプロパティの宣言が見つかりません'decisionText。
ps:Interface Builderでラベルをクリックすると、ファイルの所有者にマップされた参照アウトレットの下に「decisionText」という名前が表示されます。
これで立ち往生。:(
提案されたように、私は行@synthsizedecisionTextを削除して使用しました:
@property (nonatomic,weak) IBOutlet UILabel *decisionText ;
今、私はエラーを受け取ります:'weak'の前にプロパティ属性が必要です
ドットMファイル:
#import "ClickButtonViewController.h"
@implementation ClickButtonViewController;
//@synthesize decisionText ;
@property (weak,nonatomic) IBOutlet UILabel *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