セレクター「setTitle:forState:」を宣言する「NSArray」の可視 @interface はありません
アプリを実行すると、エラーが 1 つだけ見つかり、エラーは No visible @interface for 'NSArray' declares the selector 'setTitle:forState:' です
ここに私のコードがあります
< #import "CardGameViewController.h"
#import "PlayingCardDeck.h"
@interface CardGameViewController ()
@property (weak, nonatomic) IBOutlet UILabel *flipslabel;
@property(nonatomic) int flipCount;
@property (strong, nonatomic) IBOutletCollection(UIButton) NSArray *cardButtons;
@property (strong, nonatomic) Deck *deck;
@end
@implementation CardGameViewController
-(void)setCardButtons:(NSArray *)cardButtons
{
_cardButtons = cardButtons;
for (UIButton *cardButton in self.cardButtons){
Card *card = [self.deck drawRandomCard];
[cardButtons setTitle:card.contents forState:UIControlStateSelected];
}
}
- (Deck *)deck
{
if(!_deck) _deck=[[PlayingCardDeck alloc] init];
return _deck;
}
- (void)setFlipCount:(int)flipCount
{
_flipCount = flipCount;
self.flipslabel.text= [NSString stringWithFormat:@"Flips: %d", self. flipCount];
}
- (IBAction)flipCard:(UIButton *)sender
{
sender.selected=!sender.isSelected;
self.flipCount++;
}
@end
エラーは何だと思いますか??