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
Lanz Ceniza
4,419 PointsHELP CGRECT and Frame
We are back to working on the random quotes app and have created a button property called showQuote. We need to place this button towards the bottom of the screen. Assign the following coordinates to showQuote button: X: 100, Y: 250, Width: 280, Height: 44
```#import "THViewController.h"
@implementation THViewController
-
(void)viewDidLoad { [super viewDidLoad];
// Add your code below! The property for THViewController's // button is named 'showQuote'. self.showQuote.frame = CGRectMake(100, 250, 280, 44)
(IBAction)buttonPressed { self.showQuote.text = @"YES"; }
@end```
1 Answer
Stone Preston
42,016 Pointsself.showQuote.frame = CGRectMake(100, 250, 280, 44)
you are missing a semi colon at the end of that statement. Fix that and see if it works
thomas bethell
7,772 Pointsthomas bethell
7,772 PointsStone, I am actually struggling with this exact problem. I have entered '''objective-c self.showQuote.frame=CGRectMake(100, 259, 280, 44); ''' but it is telling me i need to set the 'frame property of the button.'(which is inside of viewDidLoad) (note: I do not have the IBAction in mine, but did try it with that.