Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Dylan Aresu
9,687 Pointsconflicting return type in implementation of 'hit' 'UIButton *' vs 'void'????Objective c!
title says it all, literally have no idea.. please help.
2 Answers
Dylan Aresu
9,687 Pointsmy .m snippet
- (IBAction)stick { int dealersHand = [self.playersHand dealersHand]; int playersHand = [self.playersHand playersHand]; if(playersHand > dealersHand & playersHand <= 21) { UIImage *img = [UIImage imageNamed:@"youwin.png"]; [_result setImage:img]; } else { UIImage *img = [UIImage imageNamed:@"youlose.png"]; [_result setImage:img]; }
Dylan Aresu
9,687 Pointsmy .h file
import <UIKit/UIKit.h>
@class playersHand;
@interface ViewController : UIViewController
@property(strong, nonatomic) IBOutlet UIImageView *card1; @property(strong, nonatomic) IBOutlet UIImageView *card2; @property (strong, nonatomic) IBOutlet UIImageView *card3; @property (strong, nonatomic) IBOutlet UIImageView *card4; @property(strong, nonatomic) IBOutlet UIImageView *result; @property (strong, nonatomic) IBOutlet UIButton *hit; @property (strong, nonatomic) IBOutlet UIButton *stick;
@property(strong, nonatomic)playersHand *playersHand; @end