0
#import "BGReviewController.h"

@interface BGReviewController (protected)
@property (weak, nonatomic) IBOutlet UIImageView *backgroundImage;
@property (weak, nonatomic) IBOutlet UIButton *dislikeButton;
@property (weak, nonatomic) IBOutlet UIButton *likeButton;
@property (weak, nonatomic) IBOutlet UIButton *post;
@property (weak, nonatomic) IBOutlet UIButton *cancel;
@property (weak, nonatomic) IBOutlet UITextView *textView;
@end

次に、次を追加します。

@synthesize backgroundImage = _backgroundImage;
@synthesize dislikeButton = _dislikeButton;
@synthesize likeButton = _likeButton;
@synthesize post = _post;
@synthesize cancel = _cancel;
@synthesize textView = _textView;

そして、エラーが発生しました:/business/Dropbox/badgers/BadgerNew/BGReviewController.m:32:13:カテゴリ「保護された」で宣言されたプロパティはクラス実装で実装できません

カテゴリの実装ファイルで合成を宣言してから、ivarを明示的に配置する必要がありますか?

4

2 に答える 2

1

カテゴリ内で @synthesize を使用することはできません。getter と setter を手動で行う必要があります。

この答えをチェックしてください

于 2013-03-20T11:34:37.027 に答える
1

交換

@interface BGReviewController (protected)

@interface BGReviewController ()

于 2013-03-20T11:39:37.010 に答える