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 trialSan Francisco
28,373 PointsNot sure why I can't get this to pass: quoteLabel.text = "A stitch in time saves nine."
I tried checking the forum for creating an iPhone application with Objective-C but could only find answers in creating an iPhone application with Swift...since the forum cuts off the full name you can't see which one you are in until you click on the answers...anyway, my code is attached can't seem to get past this simple 1 step challenge. Thanks! :)
#import "UIViewController.h"
#import "UILabel.h"
@interface ViewController: UIViewController
@property (strong, nonatomic) IBOutlet UILabel *quoteLabel;
- (IBAction)quoteButtonPressed;
@end
#import "ViewController.h"
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)quoteButtonPressed {
quoteLabel.text = "A stitch in time saves nine."
}
@end
2 Answers
Stone Preston
42,016 Pointsyou need to reference the property using self. Also remember that string literals being with @. Dont forget your semicolon
- (IBAction)quoteButtonPressed {
self.quoteLabel.text = @"A stitch in time saves nine.";
}
San Francisco
28,373 PointsBless you Stone!