Sunday, 11 August 2013

No visible @interface for 'NSArray' declares the selector 'setTitle:forState:'

No visible @interface for 'NSArray' declares the selector
'setTitle:forState:'

No visible @interface for 'NSArray' declares the selector
'setTitle:forState:'
When I run the app I find only one error and the error is No visible
@interface for 'NSArray' declares the selector 'setTitle:forState:'
and here is my code
< #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
what do you think the error is ??

No comments:

Post a Comment